Skip to content

Conversation

@Calinou
Copy link
Member

@Calinou Calinou commented Aug 8, 2024

Images were generated using https://github.com/Calinou/godot-cubemap-generator.

I have two questions though:

  • The X axis seems to be inverted when I display the cubemap using a sky shader. In the project linked above, I've had to swap the X+ and X- images' positions for the cubemap display to look correct in example_cubemap_display.tscn (the image is included in the repository).

  • The whole cubemap texture is also flipped (for the X and Z axes) when displayed as a sky shader. You can notice this if you set the shader parameter in the sky shader of example_cubemap_display.tscn to display one of the cubemap template images; letters will appear flipped.

Once I figure out these issues, I can look into adding more documentation and templates for cubemap arrays. (I've already started by mentioning that they only work with Forward+/Mobile, not Compatibility, due to OpenGL not supporting cubemap arrays until OpenGL 4.x.)

@Calinou Calinou added enhancement topic:rendering area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.2 topic:shaders topic:import labels Aug 8, 2024
@Calinou Calinou requested review from Chaosus and clayjohn August 8, 2024 17:37
@skyace65
Copy link
Contributor

skyace65 commented Aug 9, 2024

How standardized are cubemaps across engines/3D software? If they are standardized it seems odd to add templates.

@Calinou
Copy link
Member Author

Calinou commented Aug 11, 2024

How standardized are cubemaps across engines/3D software? If they are standardized it seems odd to add templates.

They aren't really standardized as far as I can tell. It was common for engines to use 6 separate images back in the day (Quake 2/3 with its _rt, _lf, _up, _dn, _ft and _bk suffixes, which the Cube Engine also adopted).

Godot expects a single image, which makes file organization easier, but you need this template if you're converting a cubemap from another engine to make sure the orientation of all faces is right.

Basis Universal does have this comment which matches Godot's ordering: https://github.com/godotengine/godot/blob/c73ac74c4a44ccfed158b3603f809a24590bac0a/thirdparty/basis_universal/transcoder/basisu_file_headers.h#L77

However, it does not specify in which layout the source texture should be specified (it can be 1×6, 2×3, 3×2 or 6×1).

I suppose this can only get less standardized as I investigate cubemap array importing 🙂

@mhilbrunner
Copy link
Member

cc @clayjohn :)

@mhilbrunner mhilbrunner merged commit 7b26368 into godotengine:master Aug 14, 2024
@mhilbrunner
Copy link
Member

Merged. Thanks! 🎉

@Calinou Calinou deleted the importing-images-cubemap-templates branch September 2, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.2 enhancement topic:import topic:rendering topic:shaders

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants