add aabb cull for mesh, improve NodeEditor view and control

add AO texture
This commit is contained in:
2026-05-17 11:33:56 +08:00
parent f50824bdb1
commit 76ebcc8f66
22 changed files with 530 additions and 154 deletions

View File

@ -85,7 +85,6 @@ float MultiSampleDepth(sampler2DMS tex, vec2 tc)
void main()
{
const float gamma = 2.2;
const float pureWhite = 1.0;
// Tonemapping
vec4 msColor = MultiSampleTexture(u_Texture, v_TexCoord);
@ -100,7 +99,7 @@ void main()
if (u_EnableSSR)
{
vec4 ssrSample = texture(u_SSRTexture, v_TexCoord);
color += ssrSample.rgb * ssrSample.a;
color = mix(color, ssrSample.rgb, ssrSample.a);
}
@ -111,14 +110,18 @@ void main()
exposure = u_ManualExposure;
color *= exposure;
vec3 mappedColor = color;
// Reinhard tonemapping operator.
// see: "Photographic Tone Reproduction for Digital Images", eq. 4
float luminance = dot(color, vec3(0.2126, 0.7152, 0.0722));
float mappedLuminance = (luminance * (1.0 + luminance / (pureWhite * pureWhite))) / (1.0 + luminance);
// Scale color by ratio of average luminances.
vec3 mappedColor = (mappedLuminance / luminance) * color;
float luminance = dot(mappedColor, vec3(0.2126, 0.7152, 0.0722));
if (luminance > 0.00001)
{
float a = 2.51;
float b = 0.03;
float c = 2.43;
float d = 0.59;
float e = 0.14;
mappedColor = clamp((mappedColor * (a * mappedColor + b)) / (mappedColor * (c * mappedColor + d) + e), 0.0, 1.0);
}
if (u_FogEnabled > 0.5)
{