godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.94k stars 3.22k forks source link

Add info to the docs and a warning when enabling the StandardMaterial Height without having enabled and added a Normal map #7442

Open golddotasksquestions opened 1 year ago

golddotasksquestions commented 1 year ago

Your Godot version: Godot 4.0.3

Issue description: Currently if you enable Height in the Standard Material without a Normal map, nothing happens. In the docs pages it says "For the best results Depth should be used together with Normal mapping." Direct Link

This is confusing because a) there is no such thing as "Depth" or a Depth map in Godot4 and b) because using it together does not seem optional as it is suggested here.

Enabling any property which has a requirement of something else being enabled or set (even a texture) should always result in at least a yellow warning triangle ⚠️ and when hovering over the warning triangle Godot should display a tooltip and tell the user what they have to do in order to get the expected result.

For example in case of the Height property: "Normal must be enabled for this property to work and both Normal as well as Height need to have a texture assigned."

However there are a lot of other properties in the Editor to which this applies. For example in the StandardMaterial still, I have no idea what I have to do in order for Transmittance to have any effect whatsoever.

URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/tutorials/3d/standard_material_3d.html

clayjohn commented 1 year ago

You can definitely use Height with a StandardMaterial. I just tested on 4.0.3.

Did you check to ensure that your scale is larger than 0? Do you also have a height texture assigned? What about an albedo texture?

Also, keep in mind, the height proper doesn't change the normal map, so it won't impact the lighting/normal of the mesh, it only offsets the UV.

golddotasksquestions commented 1 year ago

Thank you for looking into this!

Here are the steps to replicate using Godot 4.0.3:

  1. Create a new 3D scene

  2. Add a MeshInstance3D and a New SphereMesh

  3. Add a StandardMaterial to the Mesh and enable the Height property

  4. In the Height property under Texture, add a New NoiseTexture2D. Click the texture and under Noise add New FastNoiseLite.

  5. Still in the Height property, scale is 5 by default, but you may crank it up to 16 to make the effect (or the lack thereof) more obvious. For the same reason also enable deep paralax.

  6. Click and hold your middle mouse button to swivel the editor vieport camera around and observe the lack of Height shader effect.

  7. To make the Height shader effect appear, save the NoiseTexture2D, then enable Normal and load the saved NoiseTexture2D in the normal texture slot.

  8. If you now click and hold the middle mouse button and swivel around a bit, you can observe the Height shader effect.

Edit: Btw Godot 4.0.3 just crashed with this scene when I tried to close Godot clicking the window x to close.