#ok so i need some sanity checks

1 messages · Page 1 of 1 (latest)

tepid lance
#

@tropic socket Hey, took a look at this. Haven't got it completely working yet, but you've missed that this part at the end of the frag is using += so need to combine with the calculated UV from before.

uv.x += x * cols - ind * rows;
uv.y += y * rows;
#

so needs an Add node here

tropic socket
#

OOOOOO

#

shit

#

i did not realize that

#

daamn

tepid lance
#

Also, set the Alpha Clip Threshold to 0.1 or something. 1 is too high and will clip/discard any values since the texture only goes up to an alpha of 1

tropic socket
#

ok lemme fix that nodes bit

tepid lance
#

There's still another problem somewhere as the result isn't matching yet.

There's also the flickering which I think you mentioned before too - a little worrying as I'm not sure how to fix that.

tropic socket
#

yeah, but one step at a time, i should take the Vector2 that i build from the "Output UV" and add it to the original Vector2 i had, right?

tepid lance
#

Yep

tropic socket
#

the preview matches the hlsl preview at least!

#

:D

tepid lance
#

I have a feeling the last problem may be that the graph is using Floats while the code uses a lot of uint. You may basically have to put all of the frag calculations into a Custom Function.

tropic socket
#

yeah, is there a specific reason why shadergraph doesnt give you access to stuff like fixed, uints and the like?

tepid lance
#

Not sure, just doesn't have it. I guess it isn't that common to use

tropic socket
#

thats fair

#

tbh even then there might be an issue either with how i'm calculating the UV dictionary in the guide, cuz "-10" gets rendered into

#

you think it could be feasable to just well, use the source hsls inside a custom function?

#

that way i could just toy with the output if i want extra vfx

tepid lance
#

The shader code would need to be altered a bit but should be able to work in a hlsl include file for a custom function yeah

tropic socket
#

well, worth a try i guess

#

shouldnt be too difficult to extract the two main methods

#

speaking of hlsl, do you know a good way to well, edit the files?

#

visual studio doesnt really support what unity has and it's a bit annoying as it is

tepid lance
#

This works (in .hlsl file)

void FragCalcs_float(float2 uv, float _Rows, float _Cols, float4 customData1, float4 customData2, out float2 Out){
    uint ind = floor(uv.x * _Cols);
    uint x = 0;
    uint y = 0;
    uint dataInd = ind / 3;
    uint sum = dataInd < 4 ? customData1[dataInd] : customData2[dataInd - 4];

    for(int i = 0; i < 3; ++i){
        if (dataInd > 3 & i == 3) break;
        uint val = ceil(pow(10, 5 - i * 2));
        x = sum / val;
        sum -= x * val;
        val = ceil(pow(10, 4 - i * 2));
        y = sum / val;
        sum -= floor(y * val);
        if (dataInd * 3 + i == ind) i = 3;
    }                

    float cols = 1.0 / _Cols;
    float rows = 1.0 / _Rows;
    uv.x += x * cols - ind * rows;
    uv.y += y * rows;
    Out = uv;
}
tropic socket
#

i'll try this out

tepid lance
#

Graph looks like this. Used a custom interpolator for the top part since the shader has those calculations in the vert side, though not too important.

#

Also testing with unlit, but can keep it lit if you want

#

Matches the shader code now. Still flickering, not sure how to fix that part.

tropic socket
#

tbh the original hlsl shader also flickered so like

#

might have to do something with urp...? idk

#

-10 does display as -10 tho

tepid lance
#

Yeah, I'm unsure why the flickering wasn't an issue in the original tutorial. It's possible there has been changes to the ParticleSystem component and it's precision isn't the same as it used to be

tropic socket
#

funky

#

thanks dyno

#

anyways, i'll see if i can find a way to fix it, unsure if i'll be succesful tho hm

tropic socket
#

i tried toying a bunch with the shader options and it doesnt seem to be an issue on the shader indeed

#

so yeah, might be something to do with the funkin particle system

#

fun

tropic socket
#

@tepid lance this is pretty bizzare, i've decided to test this out on a built in render pipeline project, using the custom data values to display -10 (201303,0,0,0) (0,0,0,3) shows the flickering issue. oddly enough,, giving it some accuracy loss on purpose (in this case i changed 201303 to 201303.1) and the flickering isnt present anymore

#

this applies to both my URP project and the built in render pipeline project

#

so

tepid lance
tropic socket
#

i mean

#

its funny cuz like

#

even if i input 201302 it still flickers

#

it seems to happen only on round numbers

tepid lance
#

Yeah that makes sense

tropic socket
#

well, regardless

#

thank you so much for your time