Skip to content

"Convert to ShaderMaterial" doesn't work for X-Ray Stencil Mode. #107874

Closed
@HauntedBees

Description

@HauntedBees

Tested versions

  • Reproducible in v4.5.beta1.official [46c495c]

System information

Godot v4.5.beta1 - Linux Mint 21.1 (Vera) on X11 - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - NVIDIA GeForce GTX 1070 (nvidia; 535.230.02) - Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz (4 threads) - 31.30 GiB memory

Issue description

The new 4.5 stencil option for materials allows x-ray functionality. If you convert a material with this behavior to a ShaderMaterial, the generated gdshader will not have the same behavior.

Steps to reproduce

  1. Create a new MeshInstance3D and assign a StandardMaterial3D to it.
  2. Change the Stencil > Mode to X-Ray.
  3. Right click on the Material and select Convert to ShaderMaterial.
  4. The X-Ray effect no longer works.

Minimal reproduction project (MRP)

The example scene depicts two otherwise identical sphere meshes, both created with StandardMaterial3D materials with X-Ray stencils. One of the materials was converted to a ShaderMaterial but is otherwise unchanged.

stencil-example.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions