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

Add support for exporing SkyBoxes #239

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Add support for exporing SkyBoxes #239

merged 2 commits into from
Apr 15, 2024

Conversation

sercero
Copy link
Collaborator

@sercero sercero commented Apr 15, 2024

  • Add support for exporing SkyBoxes
  • Add documentation about exporting SkyBoxes

This solves #203

@sercero sercero merged commit 2b53577 into OGRECave:master Apr 15, 2024
1 check passed
@sercero sercero deleted the skybox branch April 15, 2024 01:43
top = mathutils.Euler((math.radians(180), 0, 0), 'XYZ')
bottom = mathutils.Euler((0, 0, 0), 'XYZ')

orientations = {"fr": front, "bk": back, "rt": right, "lf": left, "up": top, "dn": bottom}
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rather use the alternative naming conventions, as those are clearer:
https://github.com/OGRECave/ogre/blob/6bcf1d7d4c510104f794d779e63d330c2c8d5ebb/OgreMain/src/OgreTexture.cpp#L35

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You mean this ones: "_px", "_nx", "_py", "_ny", "_pz", "_nz"?

scene.render.image_settings.file_format = 'PNG'

# Create SkyBox camera orientations
front = mathutils.Euler((math.radians(90), 0, 0), 'XYZ')
Copy link
Member

Choose a reason for hiding this comment

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

these are the orientations used internally by Ogre:
https://github.com/OGRECave/ogre/blob/6bcf1d7d4c510104f794d779e63d330c2c8d5ebb/OgreMain/src/OgreCompositorChain.cpp#L267

the blender orientations might be different due to axis flipping. Maybe we should disable axis flipping when it comes to .scene contents altogether for simplicity.

Copy link
Collaborator Author

@sercero sercero Apr 15, 2024

Choose a reason for hiding this comment

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

You are right. I'll see how to acomodate the axis swapping with this.

In my opinion the current systems works good, because when you export a .scene what you get is what you see in Blender. Things have the "same" position and orientation, at least visually. And to me and probably most people (I guess) that is the most intuitive output.
Besides this exporter has worked like that for a loong time.

The only issue is that by default lights in Blender point towards the "bottom" or down while in OGRE by default they point towards the "back" of the screen, so they need a correction.

Copy link
Member

Choose a reason for hiding this comment

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

You are right. I'll see how to acomodate the axis swapping with this.

I just drew the results of axis swapping, and they are just all rotations. So you should be able to use orientation parameter of the skybox.

Besides this exporter has worked like that for a loong time.

I think it has never worked correctly :P see #240 where I tried to explain the issue in detail

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.

2 participants