Patch Update - Skysphere texture reading inverted - V9.3.7
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 11 MiB |
@@ -31,27 +31,23 @@ struct PixelInputType
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
float4 SkyboxPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float4 color;
|
||||
float4 colorArray;
|
||||
float4 colorSum;
|
||||
|
||||
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
// Determine the diffuse color amount of the light.
|
||||
colorArray = diffuseColor * intensity;
|
||||
|
||||
// Initialize the sum of colors.
|
||||
colorSum = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Add the light color.
|
||||
colorSum.r += colorArray.r;
|
||||
colorSum.g += colorArray.g;
|
||||
colorSum.b += colorArray.b;
|
||||
|
||||
// Multiply the texture pixel by the light color to get the final result.
|
||||
color = saturate(colorSum) * textureColor;
|
||||
|
||||
return color;
|
||||
}
|
||||
// Inverser les coordonn<EFBFBD>es de texture pour compenser les normales invers<EFBFBD>es
|
||||
float2 invertedTexCoord = float2(1.0 - input.tex.x, 1.0 - input.tex.y);
|
||||
|
||||
// <EFBFBD>chantillonner la texture avec les coordonn<EFBFBD>es invers<EFBFBD>es
|
||||
float4 textureColor = shaderTexture.Sample(SampleType, invertedTexCoord);
|
||||
|
||||
// Pour une skybox, l'<27>clairage devrait <EFBFBD>tre plus simple - on ignore l'orientation des normales
|
||||
// et on applique une luminosit<EFBFBD> uniforme ou un gradient bas<EFBFBD> sur la position (hauteur)
|
||||
|
||||
// Calculer un facteur de luminosit<EFBFBD> uniforme <EFBFBD> appliquer
|
||||
float lightFactor = saturate(intensity);
|
||||
|
||||
// Combiner la couleur ambiante et diffuse pour l'<27>clairage de la skybox
|
||||
float4 lightColor = ambientColor + (diffuseColor * lightFactor);
|
||||
|
||||
// Appliquer la couleur de l'<27>clairage <EFBFBD> la texture
|
||||
float4 finalColor = saturate(lightColor) * textureColor;
|
||||
|
||||
return finalColor;
|
||||
}
|
Reference in New Issue
Block a user