Timeline for How to modify the z depth value inside the vertex function of a surface shader?
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 23, 2022 at 15:04 | vote | accept | tigrou | ||
| Jan 21, 2022 at 17:16 | answer | added | tigrou | timeline score: 1 | |
| Jan 21, 2022 at 12:29 | comment | added | DMGregory♦ | Only four that use custom vertex functions in a Surface Shader, so that narrows down your search space. Here's one that shows transforming into view space, modifying, and transforming back — you can extend that to go all the way into post-projection space. If you just want a depth bias though, there are built in methods for that (see the "Offset" section). | |
| Jan 21, 2022 at 10:12 | comment | added | tigrou | I see what you mean, that's a little weird but it should work. Btw you have 2500+ answers, can you add a link to the one I can use as reference ? | |
| Jan 21, 2022 at 3:44 | comment | added | DMGregory♦ | So, transform it to post-projection space, modify it, then transform it back to continue down the pipeline. I've done this in a previous answer. | |
| Jan 21, 2022 at 1:16 | comment | added | tigrou |
AFAIK v.vertex is before projection, I would like to modify the properties after projection (at that moment, z property should be what is written to depth buffer)
|
|
| Jan 21, 2022 at 1:09 | comment | added | DMGregory♦ |
Did you mean to write to v.vertex, which is the vertex position that gets used for projection and depth testing?
|
|
| Jan 21, 2022 at 1:05 | history | asked | tigrou | CC BY-SA 4.0 |