Questions with Texture Using FIXED_EQUIRECTANGULAR_MIRRORED_MODE

Please look at these two examples.

When I tried using Texture to load an isometric cube map as a skybox, its default rotation differed by 90 degrees from the CubeTexture loaded via env. Moreover, I couldn’t seem to rotate the Texture like I could with CubeTexture.rotationY.

To improve skybox loading efficiency, I had no choice but to do this.
I discovered that preprocessed env files used as skyboxes differed from the original images. This is likely caused by HDRFiltering.

Therefore, I opted to load skyboxes and env files separately. Skyboxes are displayed as high-resolution textures using equidistant columnar mapping.
Ambient light uses low-resolution preprocessed env files.

I achieved rotation by overriding the shader using a material plugin. However, my question is: as a skybox texture, this approach eliminates the need for cube map conversion and significantly outperforms CubeTexture in terms of skybox efficiency. Should we consider refining the EQUIRECTANGULAR mode of Texture to more easily achieve the same effect as CubeTexture?

Do you want to do a PR for it ?

Of course, do you think it’s better to implement it as a plugin or to extend the existing coordinatesMode enumeration?

As you added the rotation support, I guess we should only add it to the existing ? without new mode or plugin ?

Because this texture mapping mode is called FIXED_EQUIRECTANGULAR_MIRRORED_MODE, the semantics of ‘fixed’ may become ambiguous if modified directly.

Of course, if you want to modify it directly, you can do it this way.

vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos, vec3 worldNormal, vec3 direction)
{
	float lon = atan(direction.z, direction.x);
	float lat = acos(direction.y);
	vec2 sphereCoords = vec2(lon, lat) * RECIPROCAL_PI2 * 2.0;
	float s = sphereCoords.x * 0.5 + 0.5;
	float t = sphereCoords.y;

	return vec3(1.0 - s, t, 0);	
}

to

vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos, vec3 worldNormal, vec3 direction, mat4 reflectionMatrix)
{
    vec4 transformedDir = reflectionMatrix * vec4(direction, 0.0);
    vec3 transforDirection = normalize(transformedDir.xyz);    
	float lon = atan(transforDirection.z, transforDirection.x);
	float lat = acos(transforDirection.y);
	vec2 sphereCoords = vec2(lon, lat) * RECIPROCAL_PI2 * 2.0;
	float s = sphereCoords.x * 0.5 + 0.5;
	float t = sphereCoords.y;

	return vec3(1.0 - s, t, 0);	
}
	return computeMirroredFixedEquirectangularCoords(worldPos, worldNormal, direction);

to

	return computeMirroredFixedEquirectangularCoords(worldPos, worldNormal, direction, reflectionMatrix);

computeFixedEquirectangularCoords Similarly。

Agree, you can use the one you prefer ?