google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.75k stars 1.88k forks source link

The clipSpaceTransform matrix cannot fully transform the vertex position #7657

Closed wddl closed 7 months ago

wddl commented 7 months ago

⚠️ Issues not using this template will be systematically closed.

Describe the bug I need to set gl_Position in the vertex shader. A workaround is to set the material.clipSpaceTransform matrix in the device domain. However, this matrix cannot affect the z component of the vertex; it can only transform x and y.

To Reproduce Steps to reproduce the behavior:

  1. set material use device domain
  2. set the material.clipSpaceTransform matirx,but the matrix cannot affact the z component of the vertex

Expected behavior The material.clipSpaceTransform matirx can affect the z component of the vertex

Screenshots

Logs

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

romainguy commented 7 months ago

clip space transform can affect the Z component. In the device domain you can also use the world from clip transform matrix for this.