0
Completed

Vector4 input on texture 2D

Colin Knueppel 10 years ago updated by Freya Holmér (Developer) 10 years ago 9
I'm trying to do a rotation prior to a UV distortion to create a perspective trick. This requires two sets of UV distortion. One to rotate the original image and then the second to distort the resulting image. The only object that can receive UVs and texture info is the Texture_2D, but the tex input only allows a texture_asset input. If it allowed any vector4 into that input, I could do this trick.

Answer

-1
Answer
Completed
Just use the UV input. UV coordinates are always only two components for texture mapping. What you'll want to do is to first rotate UV coords using the UV coordinate node and the Rotator node, then use the add node to add a distorsion texture to it, and then plug it into the UV input of the Texture 2D node
-1
Answer
Completed
Just use the UV input. UV coordinates are always only two components for texture mapping. What you'll want to do is to first rotate UV coords using the UV coordinate node and the Rotator node, then use the add node to add a distorsion texture to it, and then plug it into the UV input of the Texture 2D node
I tried this, and it doesn't work.
Picture two identical 0 to 1 gradients. If you rotate one 180 and add them together, you get a solid 1 value. 
So, when I attempt this add method, because I'm adding to gradients that are rotating in and out of 180, the object distorts wider and skinnier repeatedly. 

There is no distortion I can do to a rotating gradient by using other gradients to reach the effect I'm looking for. I need to distill that information into an image and then create a new UV distortion over top. If texture_2d allowed vector4 instead of a specific texture input, I could feed the rotating image into the vector4 input and then a new UV to distort it. 
"If texture_2d allowed vector4 instead of a specific texture input"

A Vector4 Doing what, exactly? Texture distortion is done using UV coordinates, and they are *always* Vector2s, unless you're using 3D textures.

I'm sure it's possible by just altering UV coordinates in a chain.
I want a Vector 4 instead of the texture input, not instead of UV.
Right now the input on a texture_2d input is locked to only connect to a texture output from texture_asset. If it accepted a vector4 (rgba), I could apply a uv to an image, output that image into another texture_2d node and then apply a separate UV. 

I'm in the process of uploading a video to show the issue. 
To get an idea of the effect I'm trying, see this hearthstone image, Healing touch. It has two rotating but distorted disks. If you can demonstrate out how to make that effect, please let me know.

I'm still trying to think through the problem, but here is the demonstration. 

Little correction, when I say yellow opposes yellow, I meant red. I do realize the yellow is the combination of green and red.

Also, there may be some way of doing this using UV tricks, so if anyone knows, I'd love to hear it. I think maybe a multiply with a stationary against the rotating may work.. not sure. 
Although, even if that were to work, I'm wondering if there would be harm in allowing this change? I can think of ways around it, but if allowing vector4 wouldn't cause performance hits, it would make this process easier to setup. One could chain texture_2Ds along with UV distortion for very complex behaviors.
The more I mess with this, the less likely I think it is. 
You need a way to multiply the values based upon their facing. When the UVs are flat, you multiply them by a flat value, as they get closer to 45 degree angles, you multiply by a gradient, but the gradient needs to be facing complementary to the existing gradient.

Soo... Yeah. Anyone know another way, because I don't know how to do that.


So here's just the perspective distortion. The rest should be pretty straightforward to add
Ok. Sorry. I didn't know the rotator did a distortion as part of its rotation. If you feed a rotation into a distortion, it does a flattened rotation, like what I was experiencing. If you feed a reproportioned UV into the rotator, it skews the image like what I was looking for. 

Would it be possible to add a note that it does that distortion to the rotator descriptors in the Nodes section?
The rotator itself isn't really distorting anything, it's just rotating whatever 2D vectors you're feeding it :)