liquid warping effect not working

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: liquid warping effect not working

Post by Rachael »

Would not surprise me. Softpoly still converts voxels to mesh, and that's 12 triangles per texel. And that adds up extremely quickly in 3 dimensions. That's a lot for a CPU to handle.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: liquid warping effect not working

Post by drfrag »

It's pretty much the same, i edited BD to test it. That lookup table was already there in 2.1.x and probably much earlier.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: liquid warping effect not working

Post by Graf Zahl »

dpJudas wrote:I added the warp effect. Note that the sin there should probably be done by some lookup table (don't know if gzdoom's sin already does that or not).

The sine function already uses a lookup table, combined with linear interpolation - provided you use the correct one. This one's roughly 2-3x faster than the regular C-function 'sin'. For rendering a warped texture it may be useful to add an uninterpolated variant, of course
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: liquid warping effect not working

Post by drfrag »

There are a lot of them: sin, g_sin, fastsin, c_sin...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: liquid warping effect not working

Post by Graf Zahl »

g_sin and g_sindeg are the ones that should be used, depending on what value range the angle is in.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: liquid warping effect not working

Post by Rachael »

drfrag wrote:It's pretty much the same, i edited BD to test it.
Thanks.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: liquid warping effect not working

Post by Rachael »

Graf Zahl wrote:g_sin and g_sindeg are the ones that should be used, depending on what value range the angle is in.
What are the range limits?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: liquid warping effect not working

Post by Graf Zahl »

None, save for precision related issues once the numbers get too large to represent all the fractional digits.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: liquid warping effect not working

Post by drfrag »

Isn't g_sindeg for radians?
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: liquid warping effect not working

Post by drfrag »

I've tried with g_sin and i can't tell the difference.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: liquid warping effect not working

Post by Graf Zahl »

drfrag wrote:Isn't g_sindeg for radians?
No, as the name suggests, g_sindeg is for degrees. The way the table is set up, this saves a multiplication if the values being used already are in degrees, as is the case for all in-game angles.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: liquid warping effect not working

Post by drfrag »

I don't know but with g_sindeg the effect doesn't work.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: liquid warping effect not working

Post by Graf Zahl »

Of course not, the code was written for radians.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: liquid warping effect not working

Post by Rachael »

drfrag wrote:I don't know but with g_sindeg the effect doesn't work.
drfrag do you know what Radians are?


It's the natural calculations that occur from the actual trig formulae when applied to a real triangle. 360 degrees is pi * 2 radians.

That is why attempting to use a "degrees" function in a formula designed for "radians" does not work. Radians are a unit of angles that are different than Degrees.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: liquid warping effect not working

Post by drfrag »

Heh, in theory i should know. Remember that technically i'm a technical engineer AKA half-assed engineer which is the middle category for computer science in Spain, unfortunately formation was mostly theorical at university. So it was that thing, now i remember. :)
Anyway it seems it's not worth changing it, do you see any difference? I don't.
Post Reply

Return to “Closed Bugs [GZDoom]”