feat: simplified Internal_OnShaderLoaded
This commit is contained in:
parent
87e13e2069
commit
972ce010ac
|
@ -63,14 +63,12 @@ void RenderNextFrame() {
|
||||||
|
|
||||||
void Internal_OnShaderLoaded(ShaderResource resource) {
|
void Internal_OnShaderLoaded(ShaderResource resource) {
|
||||||
list_add(&g_shaders, &resource);
|
list_add(&g_shaders, &resource);
|
||||||
int light_direction_loc = GetShaderLocation(*resource.resource, "lightDirection");
|
int const light_direction_loc = GetShaderLocation(*resource.resource, "lightDirection");
|
||||||
int ambient_level_loc = GetShaderLocation(*resource.resource, "ambientLight");
|
int const ambient_level_loc = GetShaderLocation(*resource.resource, "ambientLight");
|
||||||
Vector3 lightdir = MATRIX_FORWARD(g_light_direction);
|
|
||||||
Vector4 ambient_color = {0.07, 0.08, 0.12, 1.0};
|
|
||||||
if(light_direction_loc != -1)
|
if(light_direction_loc != -1)
|
||||||
SetShaderValue(*resource.resource, light_direction_loc, &MATRIX_FORWARD(g_light_direction), SHADER_UNIFORM_VEC3);
|
SetShaderValue(*resource.resource, light_direction_loc, &MATRIX_FORWARD(g_light_direction), SHADER_UNIFORM_VEC3);
|
||||||
if(ambient_level_loc != -1)
|
if(ambient_level_loc != -1)
|
||||||
SetShaderValue(*resource.resource, ambient_level_loc, &ambient_color, SHADER_UNIFORM_VEC4);
|
SetShaderValue(*resource.resource, ambient_level_loc, &(Vector4){0.07, 0.08, 0.12, 1.0}, SHADER_UNIFORM_VEC4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Internal_OnShaderUnloaded(ShaderResource resource) {
|
void Internal_OnShaderUnloaded(ShaderResource resource) {
|
||||||
|
|
Loading…
Reference in a new issue