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.

10b206dd30e7ad09e7493aca03fd986a24ac5ade.jpeg

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

813479abda3131bd889abc868f9c135003493d70.jpeg

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:
WorldSpaceBumpOffset.jpg

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.
WorldSpaceBumpOffset.jpg

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

And here is the result

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