mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-02 03:48:00 +03:00
3d: Remove color_add uniform
Since the ambient term is now added unconditionally, the s3de per-object additive color can be folded into instance_ambient.
This commit is contained in:
@@ -92,9 +92,6 @@ uniform int diffuse_type;
|
||||
uniform float shadow_darkness;
|
||||
uniform float shadow_bias;
|
||||
uniform int alpha_mode;
|
||||
#if ENGINE == SEAL_ENGINE
|
||||
uniform vec3 color_add;
|
||||
#endif
|
||||
|
||||
in vec2 tex_coord;
|
||||
in vec2 light_tex_coord;
|
||||
@@ -139,10 +136,6 @@ void main() {
|
||||
}
|
||||
frag_rgb += texel.rgb * diffuse * color_mod.rgb * diffuse_mod;
|
||||
|
||||
#if ENGINE == SEAL_ENGINE
|
||||
frag_rgb += color_add;
|
||||
#endif
|
||||
|
||||
#if ENGINE == REIGN_ENGINE
|
||||
// Specular lighting
|
||||
if (specular_strength > 0.0) {
|
||||
|
||||
@@ -191,7 +191,6 @@ struct RE_renderer {
|
||||
GLint uv_scroll;
|
||||
GLint blend_tex;
|
||||
GLint use_blend_texture;
|
||||
GLint color_add;
|
||||
|
||||
GLuint billboard_vao;
|
||||
GLuint billboard_attr_buffer;
|
||||
|
||||
+3
-5
@@ -264,7 +264,6 @@ struct RE_renderer *RE_renderer_new(void)
|
||||
r->uv_scroll = glGetUniformLocation(r->program, "uv_scroll");
|
||||
r->blend_tex = glGetUniformLocation(r->program, "blend_tex");
|
||||
r->use_blend_texture = glGetUniformLocation(r->program, "use_blend_texture");
|
||||
r->color_add = glGetUniformLocation(r->program, "color_add");
|
||||
|
||||
glGenRenderbuffers(1, &r->depth_buffer);
|
||||
|
||||
@@ -555,7 +554,6 @@ static void reset_draw_uniforms(struct RE_renderer *r)
|
||||
{
|
||||
glUniform1f(r->alpha_mod, 1.0f);
|
||||
glUniform3f(r->diffuse_mod, 1.0f, 1.0f, 1.0f);
|
||||
glUniform3f(r->color_add, 0.0f, 0.0f, 0.0f);
|
||||
glUniform2f(r->uv_scroll, 0.0f, 0.0f);
|
||||
glUniform1i(r->has_bones, GL_FALSE);
|
||||
glUniform1f(r->specular_strength, 0.0f);
|
||||
@@ -875,8 +873,10 @@ static void render_s3de_effect(struct RE_instance *inst, struct RE_renderer *r,
|
||||
struct s3de_object *obj = &s->objects[i];
|
||||
struct s3de_object_state *st = &inst->s3de_effect->objects[i];
|
||||
|
||||
vec3 ambient;
|
||||
glm_vec3_add(inst->ambient, st->additive_color, ambient);
|
||||
glUniform3fv(r->instance_ambient, 1, ambient);
|
||||
glUniform3fv(r->diffuse_mod, 1, st->multiply_color);
|
||||
glUniform3fv(r->color_add, 1, st->additive_color);
|
||||
|
||||
switch (obj->type) {
|
||||
case S3DE_OBJ_BILLBOARD:
|
||||
@@ -893,8 +893,6 @@ static void render_s3de_effect(struct RE_instance *inst, struct RE_renderer *r,
|
||||
}
|
||||
free(keys);
|
||||
|
||||
glUniform3f(r->diffuse_mod, 1.0f, 1.0f, 1.0f);
|
||||
glUniform3f(r->color_add, 0.0f, 0.0f, 0.0f);
|
||||
if (phase == DRAW_TRANSPARENT)
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user