mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 17:43:09 +02:00
playing with the shader
This commit is contained in:
parent
1acf7fb821
commit
0d3f56e5f2
2 changed files with 10 additions and 3 deletions
|
@ -43,8 +43,12 @@ void packDeferredFragment(vec3 normal, float alpha, vec3 diffuse, vec3 specular,
|
|||
discard;
|
||||
}
|
||||
gl_FragData[0] = vec4(diffuse.rgb, alpha);
|
||||
gl_FragData[1] = vec4(bestFitNormal(normal), 1.0);
|
||||
gl_FragData[2] = vec4(specular, shininess / 128.0);
|
||||
if ( gl_FragCoord.x > 1024) {
|
||||
gl_FragData[1] = vec4(normal * 0.5 + vec3(0.5), 1.0);
|
||||
} else {
|
||||
gl_FragData[1] = vec4(bestFitNormal(normal), 1.0);
|
||||
}
|
||||
gl_FragData[2] = vec4(specular, shininess / 100.0);
|
||||
}
|
||||
|
||||
void packDeferredFragmentLightmap(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess, vec3 emissive) {
|
||||
|
|
|
@ -118,7 +118,10 @@ vec3 evalSkyboxGlobalColor(float shadowAttenuation, vec3 position, vec3 normal,
|
|||
vec3 reflectedDir = reflect(-fragEyeDir, fragNormal);
|
||||
vec3 skyTexel = evalSkyboxLight(reflectedDir, 1 - gloss).xyz;
|
||||
|
||||
vec3 color = ambient + vec3(diffuse + shading.rgb) * shading.w * shadowAttenuation * skyTexel * getLightColor(light) * getLightIntensity(light);
|
||||
// vec3 lightIrradiance = (skyTexel * (gloss) + (1 - gloss) * getLightColor(light)) * getLightIntensity(light);
|
||||
vec3 lightIrradiance = (getLightColor(light)) * getLightIntensity(light);
|
||||
|
||||
vec3 color = ambient + vec3(diffuse + shading.rgb * skyTexel) * shading.w * shadowAttenuation * lightIrradiance;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue