heyzxz Posted June 1, 2016 Share Posted June 1, 2016 Hi there, I found there are both 'ambientTexture' and 'lightmapTexture' properties on StandardMaterial in the doc, and I think I got a little confused with them. Firstly, if I'm not mistaken, a lightmap is an image with not only the shadow data but also include some environment colors on it. It's not the same thing as the Ambient Occlusion(AO) map, which is just a black and white image with only shadow data, right? If so, my questions are: 1. I used to think the 'ambientTexture' means the AO map, until I read this: 'Unleash the StandardMaterial for your babylon.js game'. It says the 'ambientTexture' on StandardMaterial is for the lightmap, if so, what is the StandardMaterial.lightmapTexture for?? 2. About the AO map, so the StandardMaterial doesn't support it, right? 3. Does the PBRMaterial.ambientTexture means the AO map? Because I found it says 'AKA Occlusion Texture in other nomenclature' in the doc. Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 1, 2016 Share Posted June 1, 2016 Hey 1. ambientTexture is used to add a value to the lighting computation: (check the baseAmbientColor here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/default.fragment.fx#L375) 2. if you are looking for a multiplicative value, then this is the goal of lightmapTexture: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/default.fragment.fx#L384 3. I leave this one to @Sebavan Quote Link to comment Share on other sites More sharing options...
Sebavan Posted June 2, 2016 Share Posted June 2, 2016 Hello, About the 3rd point, yes It means AO map. It is all different naming of the same thing, I can add it in the doc. Quote Link to comment Share on other sites More sharing options...
heyzxz Posted June 2, 2016 Author Share Posted June 2, 2016 Thanks guys! The 'default.fragment.fx' makes me clear now . I should read it before asking my questions. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted June 2, 2016 Share Posted June 2, 2016 When we put lightmap in lightmap channel, and then set useLightmapAsShadowmap to true, is it the same process that put lightmap in ambient channel ? Quote Link to comment Share on other sites More sharing options...
heyzxz Posted June 2, 2016 Author Share Posted June 2, 2016 8 hours ago, V!nc3r said: When we put lightmap in lightmap channel, and then set useLightmapAsShadowmap to true, is it the same process that put lightmap in ambient channel ? Actually no. See the shader code which Deltakosh mentioned (The first reply). The ambientColor only effects on the diffuse color, it has no effects on the other colors (specular, reflection, or emissive...). But the lightmapColor (with 'useLightmapAsShadowmap' to true) effects on the final output color. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted June 3, 2016 Share Posted June 3, 2016 Interesting, thanks ! 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.