Combine World Space UVs with Bump Offset

Hey guys.

Just wondering if any of you could help me out with a problem I’m having trying to create a parallax window shader. Basically, I’m trying to combine parallax with world space UV projection, but I’m running into a problem I can’t get my head around. My understanding of shader code is very basic, so any help you guys can give would be super helpful.

To use the world space projection material function, I have to use a textureobject rather than a texture sample, which is where I’m running into the problem. Normally, bump offset is plugged into the UV slot on a texture sample, however obviously textureobjects do not have a UV input.

One thing I have thought of is duplicating the WorldAlignedTexture material function and slotting a bumpoffset in there, but I can’t figure out how to combine it with the world space UVs! See below, I have inserted the bumpoffset into the custom WorldAlignedTexture material function, but not sure where to combine it.


Is this even the best place to combine the two functions? Or would I be better combining it in my material instead?


Just gonna give this a little bump. Anybody got any ideas? Really interested to see how this can be done.

Thanks guys, appreciate the help.

Hi, I figured out how to do world-space UV’s for Bump Offset. However, I haven’t yet figured out how to do World-Aligned Bump Offset, so this won’t show up on walls; only floors.
This current setup should be good for terrain though:

Ok, I figured out how to do it!
The only issue is that I cannot seem to get it working within a Material Function, as it wont let you use a Texture Param 2D as an input. So it has to be all within the Material which can be quite messy. Here is an example with the Base Color and Normal inputs.

I’ve attached the Material file for anyone interested. (116 KB)

And here is the result

Excellent work! I love it when people post the solutions they found. :slight_smile: