Pryme8 Posted January 29, 2018 Share Posted January 29, 2018 #include<__decl__lightFragment>[0..maxSimultaneousLights] in: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/default.fragment.fx#L40 Ok... so what does this end up looking like after it compiles? I am trying to add multi-light/shadow support identical to the standard material for a customShader. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 29, 2018 Share Posted January 29, 2018 So this is my little baby It is a system that will automatically generates X times the same code with X from 0 to maxSimultaneousLights In this case, the includes will either pick this file: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/lightFragmentDeclaration.fx or this one (if webgl2): https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/lightUboDeclaration.fx based on webgl2 support Then it will add it to the current shader replacing {X} by 0, 1, etc.. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 29, 2018 Author Share Posted January 29, 2018 jebus... that is slick. Gotcha thank you! So it would compile to something like this then?: uniform vec4 vLightData0; uniform vec4 vLightDiffuse0; uniform vec3 vLightSpecular0; uniform samplerCube shadowSampler0; uniform vec4 shadowsInfo0; uniform vec2 depthValues0; uniform vec4 vLightDirection0; uniform vec3 vLightGround0; GameMonetize 1 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.