Possible to get world/object location of pixel in frag shader?

Is it possible in a custom frag shader to get the world location of the pixel being rendered?
Ideally I would actually prefer the position of the pixel in terms of the bounding box of the object, but the world position would be fine.

I do effects that rely on this bit of information a lot in Unreal Engine, where it’s a very simple bit of data to get, I’m just not sure how to get it in Playcanvas.

Thanks!

Hi @steve_wk,

Check this topic from yesterday, it tackles exactly that: World coordinate in fragment shader - #7 by Leonidas

1 Like

Ah, amazing, thanks!