Jump to content

Additional uniforms for lighting shaders


Rastar
 Share

Recommended Posts

Is there any way to pass additional uniforms to the lighting shaders (directionallight.shader, ...) ? (Provided I have modified the sources and added those uniforms). Which is equivalent to. Is there a way to get a reference to the loaded shaders? I guess when I call Shader::Load() for those shaders I get a separate instance that I then set uniforms on, not the one actually loaded by the render code?

Link to comment
Share on other sites

The light shaders are stored in a member of the OpenGL4Camera class:

    class OpenGL4Camera : public OpenGL2Camera
   {
   public:
       Shader* shader_ambient[7];
       Shader* shader_directional[8][2][3];
       Shader* shader_point[8][2][3];
       Shader* shader_spot[8][2][3];

 

The different variations are loaded as needed, and there are 48 possible combinations.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Ahh, OK. And those 7 ambients?

 

By the way, it seems the camera (range, zoom) uniforms aren't passed to the ambient lighting shaders. While that is fine for "ordinary", view-independent ambient terms, I would like to calculate an ambient specular contribution. Would it be possible to at least hand those two to the ambient lighting shaders so I can calculate the view direction vector?

 

Thanks again!

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.

 Share

×
×
  • Create New...