Jump to content

explain this TS line?


Pryme8
 Share

Recommended Posts

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..

Link to comment
Share on other sites

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;

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...