Operating system or device, Godot version:
Ubuntu 14.04, current master branch (01d4ffd)
Issue description:
PanoramaSky without a loaded panorama texture displays an error in the editor.
Steps to reproduce:
1) Create new: WorldEnvironment & Environment
2) Background Mode: Sky
3) Create new: PanoramaSky
Error is displayed in editor console until a Panorama texture is selected / loaded (tested with .png):
drivers/gles3/rasterizer_scene_gles3.cpp:2331 - Condition ' !tex ' is true.
Error is displayed again if the texture is cleared later on.
I can confirm this bug is still present.
I can confirm this bug too. I will try to make a fix :)
Hi,
Following the discussion in the PR, the texture associated with the PanoramaSky should never be null, mean the fix would be to prevent having a PanoramaSky without a texture.
What do you preffer to fix this problem ?
ImageTexture to the PanoramaSky ?ImageTexture with the default icon.png to the PanoramaSky ?GradientTexture to the PanoramaSky ?Display an in-editor configuration warning as long as the PanoramaSky lacks a texture. See how it's done in collision objects which will show a warning as long as you don't have a collision shape; or popup dialogs which show a warning when made visible in the editor.
As PanoramaSky is not a node but a resource, the shape is not a good example for warning (popup dialogs I don't understand), is there other examples with resources with this configuration_warning mechanism?
btw what should be done here while panoramsky lacks a texture : https://github.com/godotengine/godot/blob/051f761a87f1706bde0a45da46a3dfe1afff424a/drivers/gles3/rasterizer_scene_gles3.cpp#L2332
Yeah good question, I'm still motivate to fix it if you show me the way...
Please don't use icon.png as a default ImageTexture if it requires a file resource. If you have the raw bytes to stuff into the texture, great. I agree that it would be nice to have the default texture be something recognizable. I liked the idea of a gradient.
I'd rather not have a icon.png dependency in a command line script execution use case, which I had been exploring for QA testing.
We have now entered release freeze for Godot 3.0 and want to focus only on release critical issues for that milestone. Therefore, we're moving this issue to the 3.1 milestone, though a fix may be made available for a 3.0.x maintenance release after it has been tested in the master branch during 3.1 development. If you consider that this issue is critical enough to warrant blocking the 3.0 release until fixed, please comment so that we can assess it more in-depth.
I recently had cause to revisit this for a project. I'm glad that the current behavior is classified as a bug because errors should be reserved for unrecoverable situations.
In terms of a default, I am still in favor of some kind of gradient texture. If you take the naive approach of setting the PanoramaSky panorama property to a GradientTexture, then set the GradientTexture gradient property to a Gradient you end up with a huge seam running along an edge of the scene.
For a default panorama sky gradient you would still want a sense of up and down so the gradient should run vertical instead of horizontal. I couldn't figure out a way to rotate the texture while just gluing objects together in the Editor. I suppose you could rotate it with a shader maybe, but at that point you might as well just create the gradient there too.
If we create such a gradient as an asset, I'd imagine it should look something like this:

Add a little texture and I think it pops a little more:

For a Godot default, I'd imagine that blue would be more appropriate.
IMO a PanoramaSky without a texture should just not draw at all (not even attempt to). I find strange to add an arbitrary default, it stops looking like an actual problem. If it's just a placeholder, one can use a ProceduralSky instead.
As I mentioned above:
Display an in-editor configuration warning as long as the PanoramaSky lacks a texture.
That's all. We should not do any kind of magic. No texture == misconfiguration, that's all.
This bug might have actually got worse. It will now infinitely print the error in the console. It will not stop until there is a panorama image selected or it is removed.
Most helpful comment
As I mentioned above:
That's all. We should not do any kind of magic. No texture == misconfiguration, that's all.