Progress i guess
This commit is contained in:
@@ -15,17 +15,17 @@ struct SkyboxData
|
||||
float4x4 transformMatrix;
|
||||
float4 fogBlend;
|
||||
};
|
||||
ParameterBuffer<SkyboxData> gSkyboxData;
|
||||
ParameterBlock<SkyboxData> pSkyboxData;
|
||||
|
||||
[shader("vertex")]
|
||||
VertexShaderOutput vertexMain(
|
||||
VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output;
|
||||
float3x3 cameraRotation = float3x3(gViewParams.viewMatrix);
|
||||
float3x3 cameraRotation = float3x3(pViewParams.viewMatrix);
|
||||
float4 worldPos = float4(mul(cameraRotation, input.position), 1.0f);
|
||||
//clip(dot(worldPos, clipPlane));
|
||||
output.clipPos = mul(gViewParams.projectionMatrix, worldPos);
|
||||
output.clipPos = mul(pViewParams.projectionMatrix, worldPos);
|
||||
output.texCoords = normalize(input.position);
|
||||
return output;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ struct TextureData
|
||||
TextureCube cubeMap2;
|
||||
SamplerState sampler;
|
||||
};
|
||||
ParameterBuffer<TextureData> textures;
|
||||
ParameterBlock<TextureData> pTextures;
|
||||
static const float lowerLimit = 0.0;
|
||||
static const float upperLimit = 0.1;
|
||||
|
||||
@@ -44,11 +44,11 @@ static const float upperLimit = 0.1;
|
||||
float4 fragmentMain(
|
||||
VertexShaderOutput output) : SV_Target
|
||||
{
|
||||
float4 texture1 = textures.cubeMap.Sample(textures.sampler, output.texCoords);
|
||||
float4 texture2 = textures.cubeMap2.Sample(textures.sampler, output.texCoords);
|
||||
float4 finalColor = lerp(texture1, texture2, gSkyboxData.fogBlend.w);
|
||||
float4 texture1 = pTextures.cubeMap.Sample(pTextures.sampler, output.texCoords);
|
||||
float4 texture2 = pTextures.cubeMap2.Sample(pTextures.sampler, output.texCoords);
|
||||
float4 finalColor = lerp(texture1, texture2, pSkyboxData.fogBlend.w);
|
||||
|
||||
float factor = (output.texCoords.y - lowerLimit) / (upperLimit - lowerLimit);
|
||||
factor = clamp(factor, 0.0, 1.0);
|
||||
return lerp(float4(gSkyboxData.fogBlend.xyz, 1), finalColor, factor);
|
||||
return lerp(float4(pSkyboxData.fogBlend.xyz, 1), finalColor, factor);
|
||||
}
|
||||
Reference in New Issue
Block a user