Pladnius Brooks
Pladnius Brooks

Reputation: 1308

OpenGL - Setting Built-in Uniform Variables

I have been reading through a bunch of tutorials and when I came across one about fog in OpenGL it mentioned the built in variable gl_FogParameters. Is this something that is set in the application and then accessible through the shader.

In other words, do you set the various fog variables up the same way:

glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, 10.f);
glFogf(GL_FOG_END, 40.f);

or is it actually a uniform you send to the shader?

Upvotes: 1

Views: 363

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 474386

All of the uniforms that start with gl_ track some specific part of OpenGL's fixed-function state. They get their value from GL's fixed-function state. The specification states exactly which state maps to exactly which variables.

Upvotes: 3

Related Questions