Urho3D/bin/CoreData/Shaders/GLSL/Uniforms.glsl
Lasse Öörni b8d55583f7 Squashed commit of the following:
commit a384431cd1ce230630d6a4522022de919cb55ac9
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Thu Nov 10 00:16:26 2016 +0000

    Fixed typing and style errors

commit d4f8ca2eeed2b0196b46bd391e96a511594dc738
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Thu Nov 10 00:14:02 2016 +0000

    Removed isAreaLight from attibutes

commit 62d50f3ba94d9c665358dcd7377730d968fde7be
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Mon Nov 7 22:53:45 2016 +0000

    Added documentation on area lighting options

commit 53e5844bee5caccc2a37f0dcdac3b8d4a984dd62
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Sat Nov 5 17:15:14 2016 +0000

    Fixd spacing

commit 5afa4ec59c1ecd2aa4892d4854e3b954af9cc73f
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Sat Nov 5 06:00:19 2016 +0000

    Fixed materials under deferred and light position in the scene

commit 314bc5847a44979b89f46a0272fcf5cd0f04e866
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Sat Nov 5 05:14:27 2016 +0000

    Fixed Deferred rendering

commit bde3560de71ab5a33c9cc3a4ee40029567cca5bf
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Sat Nov 5 03:26:54 2016 +0000

    Area lighting, improved IBL and improved attenuation for OpenGL

commit 52be0fc67626a9c8901091445be52bdbe99657d1
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Sat Nov 5 01:23:53 2016 +0000

    Intergrated Area ligthing with the editor, and improved texture quality

commit 5044bebe3d8799dee687ca676334f4493586d376
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Mon Oct 24 09:25:15 2016 +0100

    Tube lighting HLSL

commit f3849a93d1812345b21918a7418d12c8d3e1e3dd
Author: dragonCASTjosh <dragonCASTjosh@gmail.com>
Date:   Mon Oct 24 09:01:10 2016 +0100

    Improve IBL

commit 210bfaebb40ed977eb46f0f6f91b3b6a49ec25a7
Author: joshua Nuttall <dragoncastjosh@live.com>
Date:   Thu Sep 15 12:32:15 2016 +0100

    Made sphere lights closer to epics paper

commit c186870e9e79de9572b5302019598ac059af58cf
Author: joshua Nuttall <dragoncastjosh@live.com>
Date:   Thu Sep 15 11:57:39 2016 +0100

    Added sphere light and beginning of tube lights
2016-11-18 02:02:05 +02:00

223 lines
4.2 KiB
GLSL

// Use of constant buffers on OpenGL 3 commented out for now as it seems to be slower in practice
//#define USE_CBUFFERS
#if !defined(GL3) || !defined(USE_CBUFFERS)
// OpenGL 2 uniforms (no constant buffers)
#ifdef COMPILEVS
// Vertex shader uniforms
uniform vec3 cAmbientStartColor;
uniform vec3 cAmbientEndColor;
uniform mat3 cBillboardRot;
uniform vec3 cCameraPos;
uniform float cNearClip;
uniform float cFarClip;
uniform vec4 cDepthMode;
uniform vec3 cFrustumSize;
uniform float cDeltaTime;
uniform float cElapsedTime;
uniform vec4 cGBufferOffsets;
uniform vec4 cLightPos;
uniform vec3 cLightDir;
uniform vec4 cNormalOffsetScale;
uniform mat4 cModel;
uniform mat4 cView;
uniform mat4 cViewInv;
uniform mat4 cViewProj;
uniform vec4 cUOffset;
uniform vec4 cVOffset;
uniform mat4 cZone;
#if !defined(GL_ES) || defined(WEBGL)
uniform mat4 cLightMatrices[4];
#else
uniform highp mat4 cLightMatrices[2];
#endif
#ifdef SKINNED
uniform vec4 cSkinMatrices[MAXBONES*3];
#endif
#ifdef NUMVERTEXLIGHTS
uniform vec4 cVertexLights[4*3];
#endif
#ifdef GL3
uniform vec4 cClipPlane;
#endif
#endif
#ifdef COMPILEPS
// Fragment shader uniforms
#ifdef GL_ES
precision mediump float;
#endif
uniform vec4 cAmbientColor;
uniform vec3 cCameraPosPS;
uniform float cDeltaTimePS;
uniform vec4 cDepthReconstruct;
uniform float cElapsedTimePS;
uniform vec4 cFogParams;
uniform vec3 cFogColor;
uniform vec2 cGBufferInvSize;
uniform vec4 cLightColor;
uniform vec4 cLightPosPS;
uniform vec3 cLightDirPS;
uniform vec4 cNormalOffsetScalePS;
uniform vec4 cMatDiffColor;
uniform vec3 cMatEmissiveColor;
uniform vec3 cMatEnvMapColor;
uniform vec4 cMatSpecColor;
#ifdef PBR
uniform float cRoughness;
uniform float cMetallic;
uniform float cLightRad;
uniform float cLightLength;
#endif
uniform vec3 cZoneMin;
uniform vec3 cZoneMax;
uniform float cNearClipPS;
uniform float cFarClipPS;
uniform vec4 cShadowCubeAdjust;
uniform vec4 cShadowDepthFade;
uniform vec2 cShadowIntensity;
uniform vec2 cShadowMapInvSize;
uniform vec4 cShadowSplits;
uniform mat4 cLightMatricesPS[4];
#ifdef VSM_SHADOW
uniform vec2 cVSMShadowParams;
#endif
#endif
#else
// OpenGL 3 uniforms (using constant buffers)
#ifdef COMPILEVS
uniform FrameVS
{
float cDeltaTime;
float cElapsedTime;
};
uniform CameraVS
{
vec3 cCameraPos;
float cNearClip;
float cFarClip;
vec4 cDepthMode;
vec3 cFrustumSize;
vec4 cGBufferOffsets;
mat4 cView;
mat4 cViewInv;
mat4 cViewProj;
vec4 cClipPlane;
};
uniform ZoneVS
{
vec3 cAmbientStartColor;
vec3 cAmbientEndColor;
mat4 cZone;
};
uniform LightVS
{
vec4 cLightPos;
vec3 cLightDir;
vec4 cNormalOffsetScale;
#ifdef NUMVERTEXLIGHTS
vec4 cVertexLights[4 * 3];
#else
mat4 cLightMatrices[4];
#endif
};
#ifndef CUSTOM_MATERIAL_CBUFFER
uniform MaterialVS
{
vec4 cUOffset;
vec4 cVOffset;
};
#endif
uniform ObjectVS
{
mat4 cModel;
#ifdef BILLBOARD
mat3 cBillboardRot;
#endif
#ifdef SKINNED
uniform vec4 cSkinMatrices[MAXBONES*3];
#endif
};
#endif
#ifdef COMPILEPS
// Pixel shader uniforms
uniform FramePS
{
float cDeltaTimePS;
float cElapsedTimePS;
};
uniform CameraPS
{
vec3 cCameraPosPS;
vec4 cDepthReconstruct;
vec2 cGBufferInvSize;
float cNearClipPS;
float cFarClipPS;
};
uniform ZonePS
{
vec4 cAmbientColor;
vec4 cFogParams;
vec3 cFogColor;
vec3 cZoneMin;
vec3 cZoneMax;
};
uniform LightPS
{
vec4 cLightColor;
vec4 cLightPosPS;
vec3 cLightDirPS;
vec4 cNormalOffsetScalePS;
vec4 cShadowCubeAdjust;
vec4 cShadowDepthFade;
vec2 cShadowIntensity;
vec2 cShadowMapInvSize;
vec4 cShadowSplits;
mat4 cLightMatricesPS[4];
#ifdef VSM_SHADOW
vec2 cVSMShadowParams;
#endif
#ifdef PBR
float cLightRad;
float cLightLength;
#endif
};
#ifndef CUSTOM_MATERIAL_CBUFFER
uniform MaterialPS
{
vec4 cMatDiffColor;
vec3 cMatEmissiveColor;
vec3 cMatEnvMapColor;
vec4 cMatSpecColor;
#ifdef PBR
float cRoughness;
float cMetallic;
#endif
};
#endif
#endif
#endif