Fixed render targets; renamed GuiTest to Editor

This commit is contained in:
2025-07-05 06:03:16 +03:00
parent b2e010bdb4
commit 52d6d31241
8 changed files with 86 additions and 41 deletions

View File

@@ -2,7 +2,7 @@ OGRE_NATIVE_GLSL_VERSION_DIRECTIVE
#include <OgreUnifiedShader.h>
// SAMPLER2D(noiseMap, 0);
SAMPLER2D(reflectMap, 0);
SAMPLER2D(refractMap, 1);
// SAMPLER2D(refractMap, 1);
OGRE_UNIFORMS(
uniform vec4 viewportSize;
uniform f32vec4 cameraPosition;
@@ -16,8 +16,8 @@ MAIN_DECLARATION
screenUV.y = 1.0 - screenUV.y * 0.6 - 0.2;
// vec2 final = projectionCoord.xy / projectionCoord.w;
float depth = saturate(length(positionWS - cameraPosition.xyz) * 0.01);
vec4 reflectionColour = texture2D(reflectMap, screenUV);
vec4 refractionColour = texture2D(refractMap, screenUV);
vec4 reflectionColour = texture2D(reflectMap, screenUV * vec2(0.5, 1.0));
vec4 refractionColour = texture2D(reflectMap, screenUV * vec2(0.5, 1.0) + vec2(0.5, 0.0));
vec4 result = mix(mix(reflectionColour, refractionColour, 0.5), vec4(0.0, 1.0, 1.0, 1.0), depth);
result.a = 1.0;
gl_FragColor = result;