#(URP) 2D Animation Reinvented

1 messages · Page 1 of 1 (latest)

drifting cairn
#

Hi, im trying to recreate a shader that uses the RG values for each pixel in the maintex as UV coordinates for a lookuptex and therefor replace the pixels colors in the maintex with the colors in the lookuptex accordingly.

Here is my reference https://youtu.be/nYch_TIkq6w?t=485

For some reason after hours of experimenting and trying to debug the flow, I just cant get it to work properly. Ive tried copying the shader node by node from the video and it refuses to work for me, so here is my experiment with the shader and changed up extures to help me debug.

Ill include the debugging nodes, so to avoid confusion you can follow the selected nodes to see they do exactly what the video shows...

Explaining in more depth the process of creating animations from my recent devlog:
https://youtu.be/HsOKwUwL1bE

This is a highlight of my recent stream.
Full VOD is available here:
https://youtu.be/nHk8jL3STxg

Source code:
https://gist.github.com/aarthificial/a77bf477c6bfa51507ffc1e8f18c5635

=== Wishlist Astortion on Steam ===
https://store.s...

▶ Play video
lapis bluff
#

Are you getting a specific issue?

drifting cairn
#

the result of the shader is not what its supposed to be, and im not sure where the issue occurs as i debugged all outputs of all nodes and it seems right

#

im guessing its somewhere among interpreting RG as UV in the right way between normalized and "normal?" (0-255)

#

you could compare my end result with his

lapis bluff
#

Hmm could if discord's image server was working at all

drifting cairn
#

yeah guess ill have to wait on that one

lapis bluff
#

Worth noting that neither shaders or images use colors in the 0-255 range, that's only a mode in the color picker

drifting cairn
#

what do images use then

lapis bluff
#

Everything is 0 to 1 as a rule of thumb

drifting cairn
#

this would make the whole concept impossible

lapis bluff
#

Colors going above 1 have "HDR intensity" which glow if you have bloom enabled

drifting cairn
#

in other words then, i need to retrieve the value of each pixel between 0-255 as this is what i adjust in the image software, and use it as UV

#

or rather use it as a coordinate, and then by diving the converted values by the maintex dimensions, use them as UV to map onto the result

lapis bluff
#

I'm not sure where the 255 number comes into play

#

Seems like a custom convention from skimming the video

drifting cairn
#

i could send a yt video where he explains the concept, but in general, when drawing the maintex you use the lookuptex for color reference, and in the maintex each pixel has values RG corresponding to the XY coordinates of the pixel color in the lookuptex

lapis bluff
#

9:43 he mentions that colors are floats from 0 to 1, not to 255 so there's probably an explanation in there

drifting cairn
#

heres his original concept video, the above is an in-depth implementation

lapis bluff
#

All texture coordinates are a normalized 0 to 1 as well regardless of resolution, so I guess that step is to make the sampling easier

drifting cairn
#

it should be noted, im using way simpler textures for the sake of getting it to work before actually using it

drifting cairn
#

(URP) 2D Animation Reinvented

drifting cairn
#

so all of a sudden i get completely random values and adjustments working which is even more concerning but at least something to go off of?

#

if not for anything else, ill send them as future reference for myself lmao

#

after the last one i honestly give up on trying to make sense from this. if anyone could explain this, feel welcome to do so

#

and if youd like to test it for yourself, there are the nodes, and here are the textures im using