You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Fix flipped EYEDIR.z in sky shaders
This commit is contained in:
@@ -837,7 +837,7 @@ void RendererSceneSkyRD::init(RendererStorageRD *p_storage) {
|
|||||||
|
|
||||||
actions.renames["COLOR"] = "color";
|
actions.renames["COLOR"] = "color";
|
||||||
actions.renames["ALPHA"] = "alpha";
|
actions.renames["ALPHA"] = "alpha";
|
||||||
actions.renames["EYEDIR"] = "cube_normal";
|
actions.renames["EYEDIR"] = "eyedir";
|
||||||
actions.renames["POSITION"] = "params.position_multiplier.xyz";
|
actions.renames["POSITION"] = "params.position_multiplier.xyz";
|
||||||
actions.renames["SKY_COORDS"] = "panorama_coords";
|
actions.renames["SKY_COORDS"] = "panorama_coords";
|
||||||
actions.renames["SCREEN_UV"] = "uv";
|
actions.renames["SCREEN_UV"] = "uv";
|
||||||
|
|||||||
@@ -199,14 +199,15 @@ void main() {
|
|||||||
vec4 quarter_res_color = vec4(1.0);
|
vec4 quarter_res_color = vec4(1.0);
|
||||||
vec4 custom_fog = vec4(0.0);
|
vec4 custom_fog = vec4(0.0);
|
||||||
|
|
||||||
|
vec3 eyedir = cube_normal;
|
||||||
|
eyedir.z *= -1.0;
|
||||||
|
|
||||||
#ifdef USE_CUBEMAP_PASS
|
#ifdef USE_CUBEMAP_PASS
|
||||||
vec3 inverted_cube_normal = cube_normal;
|
|
||||||
inverted_cube_normal.z *= -1.0;
|
|
||||||
#ifdef USES_HALF_RES_COLOR
|
#ifdef USES_HALF_RES_COLOR
|
||||||
half_res_color = texture(samplerCube(half_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), inverted_cube_normal) * params.luminance_multiplier;
|
half_res_color = texture(samplerCube(half_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), eyedir) * params.luminance_multiplier;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USES_QUARTER_RES_COLOR
|
#ifdef USES_QUARTER_RES_COLOR
|
||||||
quarter_res_color = texture(samplerCube(quarter_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), inverted_cube_normal) * params.luminance_multiplier;
|
quarter_res_color = texture(samplerCube(quarter_res, material_samplers[SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP]), eyedir) * params.luminance_multiplier;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifdef USES_HALF_RES_COLOR
|
#ifdef USES_HALF_RES_COLOR
|
||||||
|
|||||||
Reference in New Issue
Block a user