mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 00:05:40 +00:00
Fixes de-selection logic in editor that caused special cases to permanently be selected such as mounted Lights
Shifted every-frame RT allocation to be stored in advancedLightBinManager Remove deprecated references to dynamicShadowMap in light materials Updated spotLight shaders to remove deprecated dynamic shadowmap reference which was causing a crash when spotlights had shadows turned on Added GLSL version of Viz_SurfaceProperties so it works on both APIs
This commit is contained in:
parent
31039de2cf
commit
ae70cccfde
8 changed files with 125 additions and 44 deletions
|
|
@ -87,12 +87,12 @@ singleton shaderData( Viz_SurfaceProperties )
|
|||
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
||||
OGLPixelShaderFile = "./shaders/Viz_SurfacePropertiesP.glsl";
|
||||
|
||||
samplerNames[0] = "deferredTex";
|
||||
samplerNames[1] = "colorBufferTex";
|
||||
samplerNames[2] = "matinfoTex";
|
||||
samplerNames[3] = "ssaoMaskTex";
|
||||
samplerNames[4] = "$backBuffer";
|
||||
samplerNames[5] = "glowBuffer";
|
||||
samplerNames[0] = "$deferredBuffer";
|
||||
samplerNames[1] = "$colorBuffer";
|
||||
samplerNames[2] = "$matInfoBuffer";
|
||||
samplerNames[3] = "$ssaoMaskTex";
|
||||
samplerNames[4] = "$backbufferTex";
|
||||
samplerNames[5] = "$glowBuffer";
|
||||
|
||||
pixVersion = 2.0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,83 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2012 GarageGames, LLC
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "../../../../core/rendering/shaders/postFX/gl/postFx.glsl"
|
||||
#include "../../../../core/rendering/shaders/gl/hlslCompat.glsl"
|
||||
#include "../../../../core/rendering/shaders/gl/lighting.glsl"
|
||||
#include "shadergen:/autogenConditioners.h"
|
||||
|
||||
#line 27
|
||||
|
||||
uniform sampler2D deferredBuffer;
|
||||
uniform sampler2D colorBuffer;
|
||||
uniform sampler2D matInfoBuffer;
|
||||
uniform sampler2D ssaoMaskTex;
|
||||
uniform sampler2D backbufferTex;
|
||||
uniform sampler2D glowBuffer;
|
||||
|
||||
uniform float mode;
|
||||
uniform vec3 eyePosWorld;
|
||||
uniform mat4 cameraToWorld;
|
||||
|
||||
out vec4 OUT_col;
|
||||
|
||||
void main()
|
||||
{
|
||||
//unpack normal and linear depth
|
||||
vec4 normDepth = deferredUncondition(deferredBuffer, IN_uv0);
|
||||
|
||||
//create surface
|
||||
Surface surface = createSurface(normDepth, colorBuffer, matInfoBuffer, IN_uv0.xy, eyePosWorld, IN_wsEyeRay, cameraToWorld);
|
||||
|
||||
OUT_col = vec4(0,0,0,1);
|
||||
|
||||
if(mode == 0)
|
||||
OUT_col.rgb = surface.baseColor.rgb;
|
||||
else if(mode == 1)
|
||||
OUT_col = vec4(surface.N.rgb,1);
|
||||
else if(mode == 2)
|
||||
OUT_col = vec4(surface.ao, surface.ao, surface.ao, 1);
|
||||
else if(mode == 3)
|
||||
OUT_col = vec4(surface.roughness, surface.roughness, surface.roughness, 1);
|
||||
else if(mode == 4)
|
||||
OUT_col = vec4(surface.metalness, surface.metalness, surface.metalness,1);
|
||||
else if(mode == 5)
|
||||
OUT_col = vec4(surface.depth, surface.depth, surface.depth,1);
|
||||
else if(mode == 6) //Diffuse Color
|
||||
OUT_col = vec4(surface.albedo.rgb,1);
|
||||
else if(mode == 7) //Specular Color
|
||||
OUT_col = vec4(surface.baseColor.rgb * surface.ao,1);
|
||||
else if(mode == 8) //Mat Flags
|
||||
OUT_col = vec4(surface.matFlag, surface.matFlag, surface.matFlag,1);
|
||||
else if(mode == 9)
|
||||
OUT_col = vec4(surface.P.xyz,1);
|
||||
else if(mode == 10)
|
||||
OUT_col = vec4(surface.R.xyz,1);
|
||||
else if(mode == 11)
|
||||
OUT_col = vec4(surface.F.rgb,1);
|
||||
else if(mode == 12)
|
||||
OUT_col = vec4(texture( ssaoMaskTex, IN_uv0 ).rgb, 1.0);
|
||||
else if(mode == 13)
|
||||
OUT_col = vec4(texture( backbufferTex, IN_uv0 ).rgb, 1.0);
|
||||
else if(mode == 14)
|
||||
OUT_col = vec4(texture( glowBuffer, IN_uv0 ).rgb, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue