• Content Count

  • Joined

  • Last visited

About Lerige

  • Rank

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1530 profile views
  1. Do you have more information on how you did the cell shading for the scene materials for the DiStraction demo? Awesome BTW

  2. Thanks all for the nice comments and ideas. @DK, davrous: I am very honoured! Please let me complete 2 or 3 buildings and update the ground texture. I should be able to achieve this by next weekend. If it's ok for you, I send you a message as soon as it's done.
  3. Hi everyone, It's a long time since I've been here, and I finally decided to work again on my small demo. It's not completely finished (still have to add some buildings and update the ground texture, and maybe fine tune the car behavior...) but here it is: http://chr.is.free.fr/distraction/ Any feedback is welcome of course.
  4. Hi Ranaan, If this can help, working on my own small demo from babylon 1.14 to 2.0, I've noticed the problem is located in "toEulerAngles" function. I've switched back to 1.14 version which give correct results for me. For example: e: {x: 0, y: 3.141592653589793, z: 0} toEulerAngles (2.0 version): {x: 3.141592653589793, y: 3.141592653589793, z: 0} toEulerAngles (1.14 version): {x: 0, y: 3.141592653589793, z: 0} I admit I've been to lazy to go further at this moment... I'll try look into this next week end if no one found the explanation before
  5. Hello Thanks for your answer. You're right: I can't use standard scene import in this case. I've decided to manage this with a parent "empty" blender object in which I put everything without shadow. This will do the job !
  6. Hi all, My context: I have to load different meshes (not a complete scene) from different babylon files, without lights, and then I assemble them in one scene. Some of the babylon files come from Blender and others from .obj conversion. All my meshes from .obj should cast shadows. But I'd like to get "cast shadows" information from Blender files, since Blender meshes could, or could not, cast shadows. The shadow generator is defined independently in the code. I also have to say that I'm both new to Babylon and Blender. Yes, I'm looking for trouble I've made three hypothesis... H1/ complete Blender meshes "cast shadow" export I've noticed a "cast shadow" check box in Blender mesh Babylon properties but nothing seems to be exported. To fix this I've added this line in io_export_babylon.py: # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def to_scene_file(self, file_handler, meshesAndNodes): file_handler.write('{') write_string(file_handler, 'name', self.name, True) write_string(file_handler, 'id', self.name) if hasattr(self, 'parentId'): write_string(file_handler, 'parentId', self.parentId) if hasattr(self, 'materialId'): write_string(file_handler, 'materialId', self.materialId) write_int(file_handler, 'billboardMode', self.billboardMode) write_vector(file_handler, 'position', self.position) write_vector(file_handler, 'rotation', self.rotation) write_vector(file_handler, 'scaling', self.scaling) write_bool(file_handler, 'isVisible', self.isVisible) write_bool(file_handler, 'isEnabled', self.isEnabled) write_bool(file_handler, 'useFlatShading', self.useFlatShading) write_bool(file_handler, 'checkCollisions', self.checkCollisions) write_bool(file_handler, 'castShadows', self.castShadows) # added line write_bool(file_handler, 'receiveShadows', self.receiveShadows) OK, now I have a complete .babylon file, but the problem is the property is not read by babylon at import... If I'm not mistaken I saw nothing in babylonFileLoader class to read this. This is easy to fix but would add a new shadow mesh property independent of shadowGenerator. This is not nice... H2/ work with materials ... and then, I've saw there is already a standard "cast" checkbox in shadow section of Blender Materials. This seems logical, and so I'd like to get back this information in babylon. I see some advantages: - I use standard Blender properties - I do not have to duplicate information between Blender material and meshes, with risk of errors Once again it's easy to export the information: first, add this line class Material: def __init__(self, material, scene, filepath): self.name = BabylonExporter.nameSpace + '.' + material.name BabylonExporter.log('processing begun of material: ' + self.name) self.ambient = material.ambient * material.diffuse_color self.diffuse = material.diffuse_intensity * material.diffuse_color self.specular = material.specular_intensity * material.specular_color self.emissive = material.emit * material.diffuse_color self.specularPower = material.specular_hardness self.alpha = material.alpha self.backFaceCulling = material.game_settings.use_backface_culling self.castShadows = material.use_cast_shadows # added line and then add this one: # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def to_scene_file(self, file_handler): file_handler.write('{') write_string(file_handler, 'name', self.name, True) write_string(file_handler, 'id', self.name) write_color(file_handler, 'ambient', self.ambient) write_color(file_handler, 'diffuse', self.diffuse) write_color(file_handler, 'specular', self.specular) write_color(file_handler, 'emissive', self.emissive) write_float(file_handler, 'specularPower', self.specularPower) write_float(file_handler, 'alpha', self.alpha) write_bool(file_handler, 'backFaceCulling', self.backFaceCulling) write_bool(file_handler, 'castShadows', self.castShadows) # added line for texSlot in self.textures: texSlot.to_scene_file(file_handler) file_handler.write('}') But once again I'll have to update babylonFileLoader to read this. Not hard, but at this moment I am not sure at all it is the "philosophy" of Babylon materials to hold this information. H3/ Forget all this and use naming convention to know what to do with casting shadows ! Conclusion: so, before doing anything, I need your opinion Maybe I completely missed the point, but it seems interesting to catch this Blender cast shadow materiel property... Thanks for reading.
  7. ok I confirm Here is a quick and dirty test : http://www.babylonjs-playground.com/#1OEPUZ#4 If you zoom back and move the camera you should see the sprites "shadow" effect on the sphere shadow. I assume this not the expected behavior cause you have "this.renderSprites = false;" by default in renderTargetTexture class. Now if you uncomment the renderManager updated fonction you should have the correct behavior : no more sprite shadows. The correction is simply to add the "if(renderSprites) {". Without this line, this boolean is not used... I hope I am clear enough
  8. Hi all, I'm playing with sprites and experiencing strange behavior with shadows. After a quick look in code I've found this in rendering manager : this._renderSprites(index); It seems it lacks a "if (renderSprites) {" arround it. I'll try to confirm this this evening when I'll have time for real tests ++
  9. Thanks for your answer and I have to apologize cause it was a too fast question... I've just found the answer : I was using ToEulerAngles to define my target rotation from a physic engine... and ToEulerAngles has been rewritten between 1.14 and 2.0... I've just still have to understand the difference now
  10. Hi all, Since this is my first post here, I'll start with congratulations to the developers and contributors of this library. Very nice work. So nice that have started to play with it I have a question regarding the follow camera between 1.14 and 2.0 alpha. I have no issue using 1.14. But it seems the camera is broken in 2.0: with 1.14 cameraTarget.rotation.y will return negative values if this angle is greater than PI.with 2.0 it will return positive values in any case (no mean to make a difference between PI/2 and -PI/2 for example, the value is PI/2 in both cases).Any explanation for this behavior ? I hope the topic has not been answered elsewhere, but I found nothing.