浏览代码

HDRenderLoop: minor convention cleanup

/main
Sebastien Lagarde 8 年前
当前提交
4f89be71
共有 3 个文件被更改,包括 17 次插入17 次删除
  1. 10
      Assets/ScriptableRenderLoop/HDRenderLoop/Debug/Resources/DebugViewMaterialGBuffer.shader
  2. 16
      Assets/ScriptableRenderLoop/HDRenderLoop/Debug/Resources/DebugViewTiles.shader
  3. 8
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Resources/Deferred.shader

10
Assets/ScriptableRenderLoop/HDRenderLoop/Debug/Resources/DebugViewMaterialGBuffer.shader


#pragma target 5.0
#pragma only_renderers d3d11 // TEMP: unitl we go futher in dev
#pragma vertex VertDeferred
#pragma fragment FragDeferred
#pragma vertex Vert
#pragma fragment Frag
#include "Common.hlsl"
#include "Color.hlsl"

float4 positionCS : SV_POSITION;
};
Varyings VertDeferred(Attributes input)
Varyings Vert(Attributes input)
{
// TODO: implement SV_vertexID full screen quad
Varyings output;

return output;
}
float4 FragDeferred(Varyings input) : SV_Target
float4 Frag(Varyings input) : SV_Target
float depth = _CameraDepthTexture.Load(uint3(coord.unPositionSS, 0)).x;
float depth = LOAD_TEXTURE2D(_CameraDepthTexture, coord.unPositionSS).x;
FETCH_GBUFFER(gbuffer, _GBufferTexture, coord.unPositionSS);
BSDFData bsdfData;

16
Assets/ScriptableRenderLoop/HDRenderLoop/Debug/Resources/DebugViewTiles.shader


#pragma target 5.0
#pragma only_renderers d3d11 // TEMP: unitl we go futher in dev
#pragma vertex VertViewTiles
#pragma fragment FragViewTiles
#pragma vertex Vert
#pragma fragment Frag
#define LIGHTLOOP_TILE_PASS 1
#define LIGHTLOOP_TILE_ALL 1

TEXTURE2D(_CameraDepthTexture);
SAMPLER2D(sampler_CameraDepthTexture);
float4 VertViewTiles(float3 positionOS : POSITION): SV_POSITION
float4 Vert(float3 positionOS : POSITION): SV_POSITION
{
return TransformWorldToHClip(TransformObjectToWorld(positionOS));
}

float4(1.0, 0.0, 0.0, 0.9) // strong red
};
float maxNrLightsPerTile = 31;
float maxNrLightsPerTile = 31; // TODO: setup a constant for that
int nColorIndex = numLights == 0 ? 0 : (1 + (int)floor(10 * (log2((float)numLights) / log2(maxNrLightsPerTile))));
nColorIndex = nColorIndex<0 ? 0 : nColorIndex;
float4 col = nColorIndex>11 ? float4(1.0, 1.0, 1.0, 1.0) : kRadarColors[nColorIndex];
int colorIndex = numLights == 0 ? 0 : (1 + (int)floor(10 * (log2((float)numLights) / log2(maxNrLightsPerTile))));
colorIndex = colorIndex < 0 ? 0 : colorIndex;
float4 col = colorIndex > 11 ? float4(1.0, 1.0, 1.0, 1.0) : kRadarColors[colorIndex];
int2 coord = pixCoord - int2(1, 1);

return color;
}
float4 FragViewTiles(float4 positionCS : SV_POSITION) : SV_Target
float4 Frag(float4 positionCS : SV_POSITION) : SV_Target
{
Coordinate coord = GetCoordinate(positionCS.xy, _ScreenSize.zw);

8
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Resources/Deferred.shader


#pragma target 5.0
#pragma only_renderers d3d11 // TEMP: unitl we go futher in dev
#pragma vertex VertDeferred
#pragma fragment FragDeferred
#pragma vertex Vert
#pragma fragment Frag
// Chose supported lighting architecture in case of deferred rendering
#pragma multi_compile LIGHTLOOP_SINGLE_PASS LIGHTLOOP_TILE_PASS

float4 positionCS : SV_POSITION;
};
Varyings VertDeferred(Attributes input)
Varyings Vert(Attributes input)
{
// TODO: implement SV_vertexID full screen quad
// Lights are draw as one fullscreen quad

return output;
}
float4 FragDeferred(Varyings input) : SV_Target
float4 Frag(Varyings input) : SV_Target
{
float4 unPositionSS = input.positionCS; // as input we have the vpos
Coordinate coord = GetCoordinate(unPositionSS.xy, _ScreenSize.zw);

正在加载...
取消
保存