Patch Update - Skysphere texture reading inverted - V9.3.7

This commit is contained in:
CatChow0 2025-05-01 20:54:20 +02:00
parent 74151de6f7
commit 41519f7154
3 changed files with 21 additions and 28 deletions

View File

@ -6,9 +6,6 @@
<component name="ChangeListManager">
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/enginecustom/src/hlsl/skybox.ps" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/hlsl/skybox.ps" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/hlsl/skybox.vs" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/hlsl/skybox.vs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/shader/SkyboxShaderClass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/shader/SkyboxShaderClass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/shader/SkyboxShaderClass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/shader/SkyboxShaderClass.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -165,7 +162,7 @@
<workItem from="1746106963725" duration="5888000" />
<workItem from="1746112904421" duration="75000" />
<workItem from="1746113092234" duration="1477000" />
<workItem from="1746117455914" duration="4814000" />
<workItem from="1746117455914" duration="5529000" />
</task>
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
<option name="closed" value="true" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

After

Width:  |  Height:  |  Size: 11 MiB

View File

@ -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ées de texture pour compenser les normales inversées
float2 invertedTexCoord = float2(1.0 - input.tex.x, 1.0 - input.tex.y);
// Échantillonner la texture avec les coordonnées inversées
float4 textureColor = shaderTexture.Sample(SampleType, invertedTexCoord);
// Pour une skybox, l'éclairage devrait être plus simple - on ignore l'orientation des normales
// et on applique une luminosité uniforme ou un gradient basé sur la position (hauteur)
// Calculer un facteur de luminosité uniforme à appliquer
float lightFactor = saturate(intensity);
// Combiner la couleur ambiante et diffuse pour l'éclairage de la skybox
float4 lightColor = ambientColor + (diffuseColor * lightFactor);
// Appliquer la couleur de l'éclairage à la texture
float4 finalColor = saturate(lightColor) * textureColor;
return finalColor;
}