add aabb cull for mesh, improve NodeEditor view and control
add AO texture
This commit is contained in:
@ -130,6 +130,7 @@ uniform sampler2D u_AlbedoTexture;
|
||||
uniform sampler2D u_NormalTexture;
|
||||
uniform sampler2D u_MetalnessTexture;
|
||||
uniform sampler2D u_RoughnessTexture;
|
||||
uniform sampler2D u_AOTexture;
|
||||
|
||||
// environment
|
||||
uniform samplerCube u_EnvRadianceTex;
|
||||
@ -146,12 +147,14 @@ uniform float u_EnvMapRotation;
|
||||
uniform vec4 u_AlbedoColor;
|
||||
uniform float u_Metalness;
|
||||
uniform float u_Roughness;
|
||||
uniform float u_AO;
|
||||
|
||||
// textureToggle
|
||||
uniform float u_AlbedoTexToggle;
|
||||
uniform float u_NormalTexToggle;
|
||||
uniform float u_MetalnessTexToggle;
|
||||
uniform float u_RoughnessTexToggle;
|
||||
uniform float u_AOTexToggle;
|
||||
|
||||
// shadow
|
||||
const int CSM_CASCADE_COUNT = 4;
|
||||
@ -485,6 +488,8 @@ void main()
|
||||
m_Params.Roughness = u_RoughnessTexToggle > 0.5 ? texture(u_RoughnessTexture, vs_Input.TexCoord).r : u_Roughness;
|
||||
m_Params.Roughness = max(m_Params.Roughness, 0.05);
|
||||
|
||||
float ao = u_AOTexToggle > 0.5 ? texture(u_AOTexture, vs_Input.TexCoord).r : u_AO;
|
||||
|
||||
// normal
|
||||
m_Params.Normal = normalize(vs_Input.Normal);
|
||||
if (u_NormalTexToggle > 0.5)
|
||||
@ -524,7 +529,7 @@ void main()
|
||||
}
|
||||
}
|
||||
|
||||
vec3 iblContribution = IBL(F0, Lr) * u_IBLContribution;
|
||||
vec3 iblContribution = IBL(F0, Lr) * u_IBLContribution * ao;
|
||||
|
||||
color = vec4(lightContribution + iblContribution, 1.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user