Clean-up in deferred_objects.frag
@@ -15,14 +15,6 @@ in vec3 nor;
layout (location = 0) out vec4 out_color;
layout (location = 1) out vec4 out_normal;
-void write(vec3 normal, vec3 color, float diffuse_intensity, float specular_intensity, float specular_power)
-{
- out_color = vec4(color, diffuse_intensity);
- int intensity = int(floor(specular_intensity * 15.0));
- int power = int(floor(clamp(specular_power, 0.0, 30.0)*0.5));
- out_normal = vec4(0.5 * normal + 0.5, float(power << 4 | intensity)/255.0);
-}
-
void main()
{
vec3 normal = normalize(gl_FrontFacing ? nor : -nor);
@@ -32,5 +24,8 @@ void main()
#else
color = surfaceColor;
#endif
- write(normal, color.rgb, diffuse_intensity, specular_intensity, specular_power);
+ out_color = vec4(color.rgb, diffuse_intensity);
+ int intensity = int(floor(specular_intensity * 15.0));
+ int power = int(floor(clamp(specular_power, 0.0, 30.0)*0.5));
+ out_normal = vec4(0.5 * normal + 0.5, float(power << 4 | intensity)/255.0);
}
\ No newline at end of file
