Commit fbb7c2d8 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

rye flavored gbuffer

parent 9a81a073
......@@ -138,7 +138,7 @@ void main()
#endif
frag_data[0] = vec4(col, 0.0); // Diffuse
frag_data[1] = vec4(spec.rgb, vertex_color.a); // Occlusion, Roughness, Metal
frag_data[1] = vec4(emissive, vertex_color.a); // Emissive
frag_data[2] = vec4(encode_normal(tnorm), vertex_color.a, GBUFFER_FLAG_HAS_PBR); // normal, environment intensity, flags
frag_data[3] = vec4(emissive,0); // Emissive
frag_data[3] = vec4(spec.rgb,0); // Occlusion, Roughness, Metal
}
......@@ -223,13 +223,13 @@ void main()
// These values MUST be encoded with a linear transfer function.
vec3 colorDiffuse = vec3(0);
vec3 colorEmissive = srgb_to_linear(texture2DRect(emissiveRect, tc).rgb);
vec3 colorEmissive = spec.rgb;
vec3 colorSpec = vec3(0);
// vec3 colorClearCoat = vec3(0);
// vec3 colorSheen = vec3(0);
// vec3 colorTransmission = vec3(0);
vec3 packedORM = spec.rgb; // Packed: Occlusion Roughness Metal
vec3 packedORM = texture2DRect(emissiveRect, tc).rgb; // Packed: Occlusion Roughness Metal
#if DEBUG_PBR_PACK_ORM0
packedORM = vec3(0,0,0);
#endif
......@@ -323,21 +323,18 @@ void main()
#endif
#if DEBUG_PBR_METAL
color.rgb = vec3(metal);
color.rgb = linear_to_srgb(color.rgb);
#endif
#if DEBUG_PBR_NORMAL_MAP
color.rgb = diffuse.rgb;
#endif
#if DEBUG_PBR_OCCLUSION
color.rgb = vec3(packedORM.r);
color.rgb = linear_to_srgb(color.rgb);
#endif
#if DEBUG_PBR_ORM
color.rgb = packedORM;
#endif
#if DEBUG_PBR_ROUGH_PERCEPTUAL
color.rgb = vec3(perceptualRough);
color.rgb = linear_to_srgb(color.rgb);
#endif
#if DEBUG_PBR_ROUGH_ALPHA
color.rgb = vec3(alphaRough);
......
......@@ -374,9 +374,9 @@ bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false)
{
bool pbr = gSavedSettings.getBOOL("RenderPBR");
bool valid = true
&& target.addColorAttachment(for_impostor ? GL_RGBA : GL_SRGB8_ALPHA8) // frag-data[1] specular or PBR packed OcclusionRoughnessMetal
&& target.addColorAttachment(for_impostor ? GL_RGBA : GL_SRGB8_ALPHA8) // frag-data[1] specular or PBR emissive
&& target.addColorAttachment(GL_RGBA12) // frag_data[2] normal+z+fogmask, See: class1\deferred\materialF.glsl & softenlight
&& (pbr ? target.addColorAttachment(GL_RGBA) : true); // frag_data[3] emissive
&& (pbr ? target.addColorAttachment(GL_RGBA) : true); // frag_data[3] PBR packed OcclusionRoughnessMetal
return valid;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment