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"> <component name="ChangeListManager">
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment=""> <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.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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -165,7 +162,7 @@
<workItem from="1746106963725" duration="5888000" /> <workItem from="1746106963725" duration="5888000" />
<workItem from="1746112904421" duration="75000" /> <workItem from="1746112904421" duration="75000" />
<workItem from="1746113092234" duration="1477000" /> <workItem from="1746113092234" duration="1477000" />
<workItem from="1746117455914" duration="4814000" /> <workItem from="1746117455914" duration="5529000" />
</task> </task>
<task id="LOCAL-00001" summary="Minor update - viewport window tweak"> <task id="LOCAL-00001" summary="Minor update - viewport window tweak">
<option name="closed" value="true" /> <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 SkyboxPixelShader(PixelInputType input) : SV_TARGET
{ {
float4 textureColor; // Inverser les coordonnées de texture pour compenser les normales inversées
float4 color; float2 invertedTexCoord = float2(1.0 - input.tex.x, 1.0 - input.tex.y);
float4 colorArray;
float4 colorSum; // Échantillonner la texture avec les coordonnées inversées
float4 textureColor = shaderTexture.Sample(SampleType, invertedTexCoord);
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
textureColor = shaderTexture.Sample(SampleType, input.tex); // 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)
// Determine the diffuse color amount of the light.
colorArray = diffuseColor * intensity; // Calculer un facteur de luminosité uniforme à appliquer
float lightFactor = saturate(intensity);
// Initialize the sum of colors.
colorSum = float4(0.0f, 0.0f, 0.0f, 1.0f); // Combiner la couleur ambiante et diffuse pour l'éclairage de la skybox
float4 lightColor = ambientColor + (diffuseColor * lightFactor);
// Add the light color.
colorSum.r += colorArray.r; // Appliquer la couleur de l'éclairage à la texture
colorSum.g += colorArray.g; float4 finalColor = saturate(lightColor) * textureColor;
colorSum.b += colorArray.b;
return finalColor;
// Multiply the texture pixel by the light color to get the final result. }
color = saturate(colorSum) * textureColor;
return color;
}