quick shader trick! 🕯️ > how to render something 'behind' a surface, with parallax! Like a candle in a lantern. We'll be placing a soft circle in screen space, at a relative 3D position in the model (with world-constant scale) 🧵0/7
I'll be using Lens Studio (@SnapAR), but this works with any shader graph or GLSL code all subgraphs can be downloaded from my git github.com/max-van-leeuwe… 3D model by Pixel Life Studio sketchfab.com/3d-models/old-… 🧵1/7
Start by converting your custom Object Position ('pos', vec3) into a Screen Position ('screen', vec2) -> clip = vec4(pos, 1) * projection * view * world -> screen = clip / clip.w (github.com/max-van-leeuwe…) Then, scale it by the screen ratio to make the coords square! 🧵2/7
Get the distance between these coordinates and the Screen UV Coordinates (scaled by screen ratio as well!) This will give you the center of the circle already 🧵3/7
@maksvanleeuwen Great work max! I see you use a custom node for coordinates space conversion, is it something that Transform Vector node of material editor cannot do?