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

Remove improper "active" attribute from skyBox in DotSceneLoader #3082

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

sercero
Copy link
Contributor

@sercero sercero commented Apr 15, 2024

This option is being used in DotSceneLoader.cpp but is absent in the DTD.

@paroj
Copy link
Member

paroj commented Apr 15, 2024

I think we should rather remove it from DotScene

@sercero
Copy link
Contributor Author

sercero commented Apr 15, 2024

Its strange the way it is done, on one hand setSkyBox() has an "enable" parameter.
On the other hand the DotSceneLoader bails if the SkyBox is not "active".
Perhaps we should maintain the "active" but turn it into the "enable".

if (!active)
return;
// Process rotation (?)
Quaternion rotation = Quaternion::IDENTITY;
if (auto pElement = XMLNode.child("rotation"))
rotation = parseQuaternion(pElement);
// Setup the sky box
mSceneMgr->setSkyBox(true, material, distance, drawFirst, rotation, m_sGroupName);

@paroj
Copy link
Member

paroj commented Apr 15, 2024

the current code comes from ogitor, so this might have been driven by some ogitor specific needs.

I would rather think about the use-case. Why would someone want to export a disabled skyBox? And is this a common enough usage to force handling of it to all importers/ exporters out there? (as they would have to follow the DTD)

@sercero
Copy link
Contributor Author

sercero commented Apr 15, 2024

I guess if you have a SkyBox in your scene you want to have it enabled 😂.

The issue is that enabled/disabled is an actual parameter of setSkyBox().

So one might argue that people would want to choose from the xml if the skybox is enabled or not.

I'm not sure what the use case would be to be honest.

@paroj
Copy link
Member

paroj commented Apr 16, 2024

The issue is that enabled/disabled is an actual parameter of setSkyBox().

this parameter is there so you can call setSkyBox(false) to disable it, which is not relevant for .scene I would say

@sercero
Copy link
Contributor Author

sercero commented Apr 16, 2024

The issue is that enabled/disabled is an actual parameter of setSkyBox().

this parameter is there so you can call setSkyBox(false) to disable it, which is not relevant for .scene I would say

Perhaps someone would want to set the SkyBox but have it disabled, and then call setSkyBox(enable) at some point in the code.

I think that the "active" or "enable" option should be in the DTD and also the behaviour of DotSceneLoader should also be changed so that it passes this option to the setSkyBox(...)

That way the DTD reflects better the OGRE API...

@paroj
Copy link
Member

paroj commented Apr 17, 2024

That way the DTD reflects better the OGRE API...

I dont think that this should be a goal of the file format. For one, I am not really happy with the current "sky" API.
Internally there are now SkyRenderers like:

void SceneManager::_setSkyBox(bool enable, const String& materialName, Real distance,
uint8 renderQueue, const Quaternion& orientation,
const String& groupName)
{
mSkyBox.setSkyBox(enable, materialName, distance, renderQueue, orientation, groupName);
}

However I do not find them convenient enough to break the old API. But when it comes to it, it is much easier to break API then changing the file format.

Furthermore, .scene is also used by the jMonkey engine, so it should not be specific to the current Ogre API:
https://wiki.jmonkeyengine.org/docs/3.4/core/asset/asset_manager.html#example-code-loading-assets

@sercero
Copy link
Contributor Author

sercero commented Apr 17, 2024

That way the DTD reflects better the OGRE API...
OK, forget I said this.

But the other point still remains.

I think that there is a use case for having the SkyBox disabled in the .scene and enabling it later.

@paroj
Copy link
Member

paroj commented Apr 17, 2024

this can be handled by disabling the skybox immediately after loading. No need to extend the file format for that.

As I said, removing stuff from a file format is really hard, so I prefer to keep things minimal here.

@sercero sercero changed the title Add occult option 'active' to the DTD Remove improper 'active' attribute from skyBox in DotSceneLoader Apr 19, 2024
@sercero sercero changed the title Remove improper 'active' attribute from skyBox in DotSceneLoader Remove improper "active" attribute from skyBox in DotSceneLoader Apr 19, 2024
@paroj paroj merged commit 261840f into OGRECave:master Apr 19, 2024
6 checks passed
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