armory3d / armory_examples

Armory Examples
https://github.com/armory3d/armory/wiki
zlib License
60 stars 38 forks source link

Fix invalid skymap type #71

Closed rpaladin closed 1 year ago

rpaladin commented 1 year ago

Currently, for this demo: https://armory3d.github.io/armory_examples_browser/#examples-particle_smoke

The demo blend's world skymap is unsupported. (Armory only supports type, Hosek / Wilkie.)

image

Because of this complication, this error is raised:

image

Simple solution, change the skymap type to the supported type.

image

MoritzBrueckner commented 1 year ago

Armory only supports type, Hosek / Wilkie

Armory does support Nishita skies, see https://github.com/armory3d/armory/pull/2149 and https://armory3d.github.io/armory_examples_browser/#examples-world_sun_direction. The warning in the node UI comes from Eevee which doesn't support it, and I don't think Armory can remove the warning as long as it's not selectable as a rendering engine (the warning goes away if you switch to Cycles for example).

I think the warning in the console (it's not an error btw) is happening because Nishita currently doesn't take the environment strength into account. The environmentStrength uniform is always added to the world shader if a sky texture is used and because of that it is also added to the shader data so that Iron knows what uniforms it needs to pass. But since it's not actually used in the shader, the shader compiler removes it and Kha then can't find it at runtime, resulting in this warning message. We should fix this in the world shader generation instead, Nishita should take the environment strength into account I think.

rpaladin commented 1 year ago

Armory does support Nishita skies

My mistake. I must have been thinking of Preetham.. https://github.com/armory3d/armory/wiki/supported_nodes#texture

rpaladin commented 1 year ago

@MoritzBrueckner thanks for the review. I just want to clarify some inconsistancies on your part that I noticed after researching your suggestions.. (This doesn't mean you're wrong in the least by the way, I still believe you're correct.)

https://armory3d.github.io/armory_examples_browser/#examples-world_sun_direction.

That demo does not use Nishita it uses Hosek / Wilkie. 🙂 Even the world material is named after it.

image

environmentStrength uniform

Do you perhaps mean envmapStrength?

MoritzBrueckner commented 1 year ago

The demo also uses Nishita skies, you can switch the scenes by using 1 and 2:

Example browser screenshot

Do you perhaps mean envmapStrength?

Oops yes, sorry.