micage Posted November 28, 2013 Share Posted November 28, 2013 hello, i'm trying to export my baked ligthmaps from blender. As my model should not receive any dynamic lighting, i created the first UV set for the "Emit" slot and a second one, lightmap packed, for the "Ambient" slot. So i have two different sets of texture coordinates for two different texture slots. The python exporter seems to have problems with that: (excerpt from a simpe babylon file, exporting a quad) ,"uvs":[0.2066,0.2066,0.7934,0.2066,0.2066,0.7934,0.7934,0.7934],"uvs":[0.2066,0.2066,0.7934,0.2066,0.2066,0.7934,0.7934,0.7934]],"indices":[0,1,2,1,3,2] It produces two identical UV arrays and mistakingly adds a bracket "]" at the end of the second one. Does Babylon support multiple texture coordinates?And Is there a way to get them from blender or maybe with FBX? In addition, is there a way to exclude objects from dynamic lighting or specific lights? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 28, 2013 Share Posted November 28, 2013 Uh! We could have a bug here:) Could you share the blender file? I'll try to debug the python exporter In the next version, we will add a new property to light: excludedMeshes. It will be a way to exclude meshes from a specific light Quote Link to comment Share on other sites More sharing options...
micage Posted November 28, 2013 Author Share Posted November 28, 2013 First, big thänx for your prompt reply.At the moment i have no clou how to share a file. (could you give me a hint ) For test purposes i corrected the exported babylon file manually:one array "uvs" and the second "uvs2", also setting "coordinatesIndex":1 Finally Lightmaps are working fine for a handcrafted quad. Fixing the exporter remains ... "excludedMeshes" is great news. But wouldn't it be easier to include meshes explicitely to a given light?Normally you wouldn't want all or most of your meshes be lit by diffuse light ... just thinking. Keep up the good work! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 29, 2013 Share Posted November 29, 2013 For me, by default a light should includes all object (this is the obvious behavior) If you have a skydrive or a dropbox you can share the blender scene (else you can send me a PM:)) Quote Link to comment Share on other sites More sharing options...
micage Posted November 29, 2013 Author Share Posted November 29, 2013 For me, by default a light should includes all object (this is the obvious behavior) If you have a skydrive or a dropbox you can share the blender scene (else you can send me a PM:))I found the error in the python export script, around line 553: if hasUV2: uvs2=uvs.rstrip(',') # this has to be: uvs2=uvs2.rstrip(',') uvs2+="]\n" I also used "mesh.uv_layers" instead of "mesh.tessface_uv_textures" to get the uvs.Maybe this is not necessary, but while testing i found out, that len(mesh.tessface_uv_textures) was zero. @ diffuse lighting:this is a complex topic, depends a lot on level design and shader management, also a matter of taste It remembered me of the first steps with the DirectX fixed function pipeline. What one would not like is having static geometry lit by vertex lighting. But there is the possibility to write custom materials, not depending on vertex lighting or even any lights. cheers Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 29, 2013 Share Posted November 29, 2013 I saw this bug and the exporter on github is now fixed:) (I kept mesh.tessface_uv_texture, could you try it? )https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender @diffuse lighting: exactly Quote Link to comment Share on other sites More sharing options...
micage Posted November 29, 2013 Author Share Posted November 29, 2013 yes, it's working now! No need for extracting UVs from "uv_layers". I think, i didn't get UVs from "mesh.tessface_uv_texture" because i was in EDIT mode and inside the phyton console. Fine. Excited to see the shape of things to come ... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 30, 2013 Share Posted November 30, 2013 Good:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.