Download

Quick question regarding offsetting a texture

Hello, first time poster but definitely not last time, and I haz questions! I generally try and learn things on my own and not bother people with silly questions but, I can’t seem to figure this one out on my own.

How do I move a texture without using the UV input on the Texture Sample node? I spend quite a considerable amount of time looking for an answer, but every answer tells you to simply connect your math regarding movement to the UV pin of a texture sample or object node. I can’t do that.

Highly inspired by The Order 1886, I started my scene, and no The Order 1886 inspired scene can be such without The Green Bottle™ from the Under Siege chapter. And while though I got a decent glass material, making the refraction blurry by using that screen space SpiralBlur - SceneTexture node, it creates the following bug;

https://dl.dropboxusercontent.com/u/12216973/SK/Glassmaterial%20bug.PNG

When at the bottom of the screen, there’s simply no data. Oddly these lines don’t appear at the other 3 sides.
I want to take the result of the SpiralBlur - SceneTexture node and simply move or offset it down a bit to hide that seam line hoping that it won’t create the same issue at the top of the screen…Or maybe scale it up a bit if it does.

So…What can I do here;

https://dl.dropboxusercontent.com/u/12216973/SK/Shaderpath.PNG

To move the texture with?

Thanks in advance! I wanted to show awesome things on my first post but…Too hopeful perhaps?

Hi,

Have you tested this out actually ingame not just in the editor? The problem here is that in the editor the render targets are bigger and include data at the edges that won’t be present in game.

There is a way to clamp the UVs without seeing that artifact as well but it will cost some instructions which is one of the reasons I did not add that option into the node by default (though perhaps it could be added as an option in the future). Basically you get the ratio of screensize to buffersize and then clamp by a pixel less than that when plugging UVs into scene color. I will try to find this snippet from one of my materials on monday.

In response to your initial question, you cannot adjust texture sampling other than modifying the initial sample UV position.

Hey, you’re right, it perfectly fine when I start the Stand Alone game option…Is there any way to view it in the editor though? How come the included data in the editor causes it to do that?

Also I’ll be really interested to see that material spinet! I mean, I have forward lighting enabled as well as planar reflections and I don’t care if I have more than 4 omnilights with overlapping influence ranges. Not exactly the actions of a man who keeps his performance in check are they? Console optimization is for the office… Home is the place to go wild~ …After making sure the window shades are completely covered.

It looks like this. You will need to pass in the lower part and do the clamp inside of the spiral blur function.

The “add” is where any refraction or offsets would go.

876944b54f360bc7d24f5336a6a21ede0e3696f1.png

In hlsl code clamp is just like

x = clamp(x, min, max);

where min = 0 and max = the bottom half of that snippet.

Note that the param “UVclamp” set to 0.98 is just a quick hack and actually bringing it in by one pixel size would be better.

Awesome, thanks. … Uhh … Only question remaining is how to I input all that to the Custom node in the Partial Blur node… I am not familiar with HLSL code, I would assume I have to add a new input and name it something, and then use it in the code, but I can’t figure out how to do it.

Oh well, looks like I’m learning HLSL. Thanks for the time spend on this! :slight_smile: