Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skydome projection to allow dome / box sky texture projections #5886

Merged
merged 20 commits into from Dec 14, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Dec 7, 2023

Fixes #5160

  • skydome projection, allowing cubemap to be rendered into a dome or a box

New API

Scene.sky.type  // SKYMESH_INFINITE, SKYMESH_BOX, SKYMESH_DOME
Scene.sky.node // GraphNode with transformation (ignored for INFINITE)
Scene.sky.center - center of the dome (tripod)  (ignored for INFINITE)

Note that the sky settings are now in a standalone Scene.sky object. In the future, all sky properties will be moved here instead of being in the Scene directly. This will give us the option to set an instance of an object like this on a camera for example, allowing different sky settings per camera.

Typical use:

        // setup dome based sky
        app.scene.sky.type = pc.SKYTYPE_DOME;
        app.scene.sky.node.setLocalScale(200, 200, 200);
        app.scene.sky.center = new pc.Vec3(0, 0.05, 0);

Skybox example with controls over the parameters:

Dome:
Screenshot 2023-12-14 at 10 59 36

Screenshot 2023-12-14 at 11 04 58

Box:
Screenshot 2023-12-14 at 11 00 07

Infinite:
Screenshot 2023-12-14 at 11 00 33

Fixes #5160

src/scene/scene.js Outdated Show resolved Hide resolved
@mvaligursky mvaligursky changed the title Skydome projection to allow flat ground Skydome projection to allow dome / box sky texture projections Dec 14, 2023
@willeastcott
Copy link
Contributor

Do we plan to have a SKYMESH_CUSTOM for a user-supplied mesh?

@mvaligursky
Copy link
Contributor Author

Do we plan to have a SKYMESH_CUSTOM for a user-supplied mesh?

It's definitely an option to add that was discussed, but in a separate PR

Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀 But please get 1 more review before merging.

@mvaligursky
Copy link
Contributor Author

@willeastcott thanks for all the comments, all done.

@mvaligursky mvaligursky merged commit 9d88597 into main Dec 14, 2023
7 checks passed
@mvaligursky mvaligursky deleted the mv-projected-skydome branch December 14, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ground-projected skydome
4 participants