Make fogColor in the fog tutorial a parameter (#5672)
* uniform fogColor fogColor is now a parameter * use new fog color parameter * convert ambient to Vector4
This commit is contained in:
parent
da9e881092
commit
7fef65a3fe
2 changed files with 7 additions and 5 deletions
|
|
@ -72,8 +72,13 @@ int main(void)
|
|||
shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
|
||||
|
||||
// Ambient light level
|
||||
Vector4 ambient = (Vector4){ 0.2f, 0.2f, 0.2f, 1.0f };
|
||||
int ambientLoc = GetShaderLocation(shader, "ambient");
|
||||
SetShaderValue(shader, ambientLoc, (float[4]){ 0.2f, 0.2f, 0.2f, 1.0f }, SHADER_UNIFORM_VEC4);
|
||||
SetShaderValue(shader, ambientLoc, &ambient, SHADER_UNIFORM_VEC4);
|
||||
|
||||
Vector4 fogColor = ColorNormalize(GRAY);
|
||||
int fogColorLoc = GetShaderLocation(shader, "fogColor");
|
||||
SetShaderValue(shader, fogColorLoc, &fogColor, SHADER_UNIFORM_VEC4);
|
||||
|
||||
float fogDensity = 0.15f;
|
||||
int fogDensityLoc = GetShaderLocation(shader, "fogDensity");
|
||||
|
|
|
|||
Loading…
Reference in a new issue