DunkleMango / GLRF

OpenGL Realtime Framework
0 stars 1 forks source link

Shader why not set uniform projectin matrix? #11

Closed lmj01 closed 5 months ago

DunkleMango commented 6 months ago

What part of the framework are you referring to? It's been like 4 years since I worked on this project. Please provide me with a bit more information.

lmj01 commented 6 months ago

ex. How i set uniform only for some mesh, like one vertex shader need customer variable, like projection matrix

DunkleMango commented 5 months ago

You can always compute the projection matrix that you need, like so for example:

glm::mat4 projection = glm::perspective(glm::radians(55.0f), (GLfloat)screenResolution.width / (GLfloat)screenResolution.height, 0.1f, 100.0f);

If you want to set the variable, all you have to do is run

configuration.setMat4("projection", projection);

on the ShaderConfiguration that you want to use.

lmj01 commented 5 months ago

I known, configurable with in scene one, not the single mesh one. And thanks your example demo, i think I known your framework.