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

Support red skybox #40

Closed
wants to merge 4 commits into from
Closed

Support red skybox #40

wants to merge 4 commits into from

Conversation

nkoenig
Copy link
Contributor

@nkoenig nkoenig commented Sep 29, 2022

Signed-off-by: Nate Koenig [email protected]

As the name suggest, this is a quick hack to get a red skybox working. This approach will be replaced by proper .dds loading when I have more time.

Here is an example SDF file for testing:

<?xml version='1.0' encoding='utf-8'?>
<sdf version="1.9">
  <world name="test">
    <scene>
      <sky>
        <cubemap_uri>/home/nkoenig/skybox_red.dds</cubemap_uri>
      </sky>
    </scene>
    <model name="ground_plane">
      <static>true</static>
      <link name="link">
        <collision name="collision">
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
          <material>
            <ambient>0.8 0.8 0.8 1</ambient>
            <diffuse>0.8 0.8 0.8 1</diffuse>
            <specular>0.8 0.8 0.8 1</specular>
          </material>
        </visual>
      </link>
    </model>
  </world>
</sdf>

@@ -682,18 +682,27 @@ export class Scene {
this.COMvisual.add(mesh);
}

public addSky(): void {
public addSky(cubemap: string | undefined): void {
var cubeLoader = new THREE.CubeTextureLoader();
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this asset comes from the websocket, we should pass the websocket loading manager here as well. Check for other cases where it was used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming that I'll add all skyboxes to fuel. I'd that okay?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm assuming that I'll add all skyboxes to fuel. I'd that okay?

It looks like this was already done, correct? That is, if I use this branch and add in a cubemap_uri to my SDF, I get a red sky as desired. So I think that means everything was properly downloaded from fuel. Do I have that right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, that sounds right

Nate Koenig and others added 2 commits September 29, 2022 15:10
Signed-off-by: Nate Koenig <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
@clalancette
Copy link
Collaborator

clalancette commented Sep 29, 2022

FYI, I rebased this onto the latest gzweb2, and added a few additional checks for null in 90c5b69. Without those, when not specifying a cubemap_uri, I was getting crashes in gzweb.

With that, I was able to test both without a cubemap_uri, where I saw a blue sky, and with a cubemap_uri, where I saw a red sky. I think that makes this a successful hack. I'll speak to @german-e-mas briefly about it to see if there is anything else we should do here.

Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This looks good to me now as a temporary hack. I'm just waiting on @ColeOSRF to confirm it works for him before merging.

@ColeOSRF
Copy link

Nate if you're able to wrap back around to this later today could you throw update the red skybox with the one in this folder? It also contains the grey sky texture.
https://www.dropbox.com/scl/fo/44xtvz41xi0f8m9a6sh6i/h?dl=0&rlkey=kq8fp9vck5o5hj4h5g2b7r8ei

@nkoenig
Copy link
Contributor Author

nkoenig commented Oct 3, 2022

See #42

@nkoenig nkoenig closed this Oct 3, 2022
@nkoenig nkoenig deleted the red-sky-box-hack branch May 31, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants