MackeyK24 Posted February 18, 2017 Share Posted February 18, 2017 While trying to add additional support for my new SplatmapMaterial... I am using TerrainMaterial shader as a base/guide to make my modifies splatmap material... have a question regarding bump map... if you look in the code normal is calculated ... BUT I CANT SEE WHERE IT IS ACTUALLY BEING USED ... Please look at this: // Bump #ifdef NORMAL vec3 normalW = normalize(vNormalW); #else vec3 normalW = vec3(1.0, 1.0, 1.0); #endif #ifdef DIFFUSE baseColor = texture2D(textureSampler, vTextureUV); #if defined(BUMP) && defined(DIFFUSE) normalW = perturbNormal(viewDirectionW, baseColor.rgb); #endif now that calculates out normalW ... but after that NOWHERE is normalW being used... HOW IS BUMPING BE APPLIED ??? Attach is who vertex and fragment programs... Please tell me whats up with the BUMP feature from BABYLON.TerrainMaterial terrain.vertex.fx terrain.fragment.fx @Deltakosh , @Sebavan , @davrous or @RaananW Please Help If Can Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2017 Share Posted February 21, 2017 Just here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/bumpFragmentFunctions.fx It is using shader includes feature Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted February 22, 2017 Author Share Posted February 22, 2017 11 hours ago, Deltakosh said: Just here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/bumpFragmentFunctions.fx It is using shader includes feature Thanks Delta... I eventually figured that out... I now use a modified PBRMaterial for my SplatmapMaterial... That way i can pick ALL the regular PBR material lighting... It was actually easier than before... i just replace the: albedoColor = texture2d(albedoSampler) with the blended up splatmap textures... EASY PEASY... same thing for bumping... that way we DONT change anything from the par shaders EXCEPT of course adding the additional texture properties and blending up all those texture colors RIGHT where you would normally use texture2D(albedoSampler) and texture2D(bumpSampler)... So easy... and works beautiful, so far Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 22, 2017 Share Posted February 22, 2017 and what about....doc? (It is my job you know :)) 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.