forked from townforge/Urho3D
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
210 lines
4.3 KiB
HLSL
210 lines
4.3 KiB
HLSL
#ifndef D3D11
|
|
|
|
// D3D9 uniforms (no constant buffers)
|
|
|
|
#ifdef COMPILEVS
|
|
|
|
// Vertex shader uniforms
|
|
uniform float3 cAmbientStartColor;
|
|
uniform float3 cAmbientEndColor;
|
|
#ifdef BILLBOARD
|
|
uniform float3x3 cBillboardRot;
|
|
#endif
|
|
uniform float3 cCameraPos;
|
|
uniform float cNearClip;
|
|
uniform float cFarClip;
|
|
uniform float4 cDepthMode;
|
|
uniform float cDeltaTime;
|
|
uniform float cElapsedTime;
|
|
uniform float3 cFrustumSize;
|
|
uniform float4 cGBufferOffsets;
|
|
uniform float4 cLightPos;
|
|
uniform float3 cLightDir;
|
|
uniform float4 cNormalOffsetScale;
|
|
uniform float4x3 cModel;
|
|
uniform float4x3 cView;
|
|
uniform float4x3 cViewInv;
|
|
uniform float4x4 cViewProj;
|
|
uniform float4 cUOffset;
|
|
uniform float4 cVOffset;
|
|
uniform float4x3 cZone;
|
|
#ifdef SKINNED
|
|
uniform float4x3 cSkinMatrices[MAXBONES];
|
|
#endif
|
|
#ifdef NUMVERTEXLIGHTS
|
|
uniform float4 cVertexLights[4*3];
|
|
#else
|
|
uniform float4x4 cLightMatrices[4];
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef COMPILEPS
|
|
|
|
// Pixel shader uniforms
|
|
uniform float4 cAmbientColor;
|
|
uniform float3 cCameraPosPS;
|
|
uniform float cDeltaTimePS;
|
|
uniform float4 cDepthReconstruct;
|
|
uniform float cElapsedTimePS;
|
|
uniform float4 cFogParams;
|
|
uniform float3 cFogColor;
|
|
uniform float2 cGBufferInvSize;
|
|
uniform float4 cLightColor;
|
|
uniform float4 cLightPosPS;
|
|
uniform float3 cLightDirPS;
|
|
uniform float4 cNormalOffsetScalePS;
|
|
uniform float4 cMatDiffColor;
|
|
uniform float3 cMatEmissiveColor;
|
|
uniform float3 cMatEnvMapColor;
|
|
uniform float4 cMatSpecColor;
|
|
#ifdef PBR
|
|
uniform float cRoughness;
|
|
uniform float cMetallic;
|
|
uniform float cLightRad;
|
|
uniform float cLightLength;
|
|
#endif
|
|
uniform float3 cZoneMin;
|
|
uniform float3 cZoneMax;
|
|
uniform float cNearClipPS;
|
|
uniform float cFarClipPS;
|
|
uniform float4 cShadowCubeAdjust;
|
|
uniform float4 cShadowDepthFade;
|
|
uniform float2 cShadowIntensity;
|
|
uniform float2 cShadowMapInvSize;
|
|
uniform float4 cShadowSplits;
|
|
uniform float4x4 cLightMatricesPS[4];
|
|
#ifdef VSM_SHADOW
|
|
uniform float2 cVSMShadowParams;
|
|
#endif
|
|
#endif
|
|
|
|
#else
|
|
|
|
// D3D11 uniforms (using constant buffers)
|
|
|
|
#ifdef COMPILEVS
|
|
|
|
// Vertex shader uniforms
|
|
cbuffer FrameVS : register(b0)
|
|
{
|
|
float cDeltaTime;
|
|
float cElapsedTime;
|
|
}
|
|
|
|
cbuffer CameraVS : register(b1)
|
|
{
|
|
float3 cCameraPos;
|
|
float cNearClip;
|
|
float cFarClip;
|
|
float4 cDepthMode;
|
|
float3 cFrustumSize;
|
|
float4 cGBufferOffsets;
|
|
float4x3 cView;
|
|
float4x3 cViewInv;
|
|
float4x4 cViewProj;
|
|
float4 cClipPlane;
|
|
}
|
|
|
|
cbuffer ZoneVS : register(b2)
|
|
{
|
|
float3 cAmbientStartColor;
|
|
float3 cAmbientEndColor;
|
|
float4x3 cZone;
|
|
}
|
|
|
|
cbuffer LightVS : register(b3)
|
|
{
|
|
float4 cLightPos;
|
|
float3 cLightDir;
|
|
float4 cNormalOffsetScale;
|
|
#ifdef NUMVERTEXLIGHTS
|
|
float4 cVertexLights[4 * 3];
|
|
#else
|
|
float4x4 cLightMatrices[4];
|
|
#endif
|
|
}
|
|
|
|
#ifndef CUSTOM_MATERIAL_CBUFFER
|
|
cbuffer MaterialVS : register(b4)
|
|
{
|
|
float4 cUOffset;
|
|
float4 cVOffset;
|
|
}
|
|
#endif
|
|
|
|
cbuffer ObjectVS : register(b5)
|
|
{
|
|
float4x3 cModel;
|
|
#ifdef BILLBOARD
|
|
float3x3 cBillboardRot;
|
|
#endif
|
|
#ifdef SKINNED
|
|
uniform float4x3 cSkinMatrices[MAXBONES];
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef COMPILEPS
|
|
|
|
// Pixel shader uniforms
|
|
cbuffer FramePS : register(b0)
|
|
{
|
|
float cDeltaTimePS;
|
|
float cElapsedTimePS;
|
|
}
|
|
|
|
cbuffer CameraPS : register(b1)
|
|
{
|
|
float3 cCameraPosPS;
|
|
float4 cDepthReconstruct;
|
|
float2 cGBufferInvSize;
|
|
float cNearClipPS;
|
|
float cFarClipPS;
|
|
}
|
|
|
|
cbuffer ZonePS : register(b2)
|
|
{
|
|
float4 cAmbientColor;
|
|
float4 cFogParams;
|
|
float3 cFogColor;
|
|
float3 cZoneMin;
|
|
float3 cZoneMax;
|
|
}
|
|
|
|
cbuffer LightPS : register(b3)
|
|
{
|
|
float4 cLightColor;
|
|
float4 cLightPosPS;
|
|
float3 cLightDirPS;
|
|
float4 cNormalOffsetScalePS;
|
|
float4 cShadowCubeAdjust;
|
|
float4 cShadowDepthFade;
|
|
float2 cShadowIntensity;
|
|
float2 cShadowMapInvSize;
|
|
float4 cShadowSplits;
|
|
float2 cVSMShadowParams;
|
|
float4x4 cLightMatricesPS[4];
|
|
#ifdef PBR
|
|
float cLightRad;
|
|
float cLightLength;
|
|
#endif
|
|
}
|
|
|
|
#ifndef CUSTOM_MATERIAL_CBUFFER
|
|
cbuffer MaterialPS : register(b4)
|
|
{
|
|
float4 cMatDiffColor;
|
|
float3 cMatEmissiveColor;
|
|
float3 cMatEnvMapColor;
|
|
float4 cMatSpecColor;
|
|
#ifdef PBR
|
|
float cRoughness;
|
|
float cMetallic;
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|