jessepmason Posted September 12, 2015 Share Posted September 12, 2015 Hello, would anyone know how to create a shader where you can just have a flat texture with shadows... no lighting information?So basicly an emissive texture with shadows overlaying it... i hope that makes senseI have tried modifying the StandardMaterial with no luck. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 13, 2015 Share Posted September 13, 2015 Why not simply using the StandardMaterial? Set specularColor and DiffuseColor to black, set emissiveTexture and you're good to go Quote Link to comment Share on other sites More sharing options...
jessepmason Posted September 13, 2015 Author Share Posted September 13, 2015 unless I am missing something, I dont think the shadows go over top the emissiveTexture :S This is a code from the default.fragment.fxall the shadows/diffuse go into the diffuseBase and the emissive stuff go into the emissiveColor // Compositionvec3 finalDiffuse = clamp(diffuseBase * diffuseColor + emissiveColor + vAmbientColor, 0.0, 1.0) * baseColor.rgb; Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 13, 2015 Share Posted September 13, 2015 Hi JM! Hi DK! JM: http://playground.babylonjs.com/#1NVRFH#1 Shadows on emissiveTextures. *shrug* Be well. Quote Link to comment Share on other sites More sharing options...
jessepmason Posted September 13, 2015 Author Share Posted September 13, 2015 Hey Wingnut! thanks for the example but unfortunately doesn't work for what I am trying to do even though its balancing the values between the diffuse and emissive levels its grabbing the light information and adding it ontop of the diffuse thus not making it just the emissive texture and the shadow from the torus Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 14, 2015 Share Posted September 14, 2015 Ok understood. In this case you were right. the best way is to start from stdMaterial code and only keep shadows. But beware: Shadows now work with diffuse so you will have to change the way it generates the final color Quote Link to comment Share on other sites More sharing options...
jessepmason Posted September 14, 2015 Author Share Posted September 14, 2015 Darn! I'll continue to try and dissect the stdMaterialThanks for the help!although it might be a cool feature to add for people who have textures with baked lighting information and just need the shadows from an animated object 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.