liquid warping effect not working

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.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: liquid warping effect not working

Re: liquid warping effect not working

by drfrag » Thu Mar 26, 2020 4:25 am

I see, performance here apparently is the same too. We could change it then.

Re: liquid warping effect not working

by Graf Zahl » Thu Mar 26, 2020 4:20 am

If you saw a difference, it would be broken. The idea is performance, not visual improvement.

Re: liquid warping effect not working

by drfrag » Thu Mar 26, 2020 4:17 am

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.

Re: liquid warping effect not working

by Rachael » Wed Mar 25, 2020 7:25 pm

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.

Re: liquid warping effect not working

by Graf Zahl » Wed Mar 25, 2020 4:08 pm

Of course not, the code was written for radians.

Re: liquid warping effect not working

by drfrag » Wed Mar 25, 2020 3:47 pm

I don't know but with g_sindeg the effect doesn't work.

Re: liquid warping effect not working

by Graf Zahl » Wed Mar 25, 2020 2:08 pm

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.

Re: liquid warping effect not working

by drfrag » Wed Mar 25, 2020 11:18 am

I've tried with g_sin and i can't tell the difference.

Re: liquid warping effect not working

by drfrag » Wed Mar 25, 2020 6:35 am

Isn't g_sindeg for radians?

Re: liquid warping effect not working

by Graf Zahl » Wed Mar 25, 2020 6:07 am

None, save for precision related issues once the numbers get too large to represent all the fractional digits.

Re: liquid warping effect not working

by Rachael » Wed Mar 25, 2020 6:04 am

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?

Re: liquid warping effect not working

by Rachael » Wed Mar 25, 2020 6:03 am

drfrag wrote:It's pretty much the same, i edited BD to test it.
Thanks.

Re: liquid warping effect not working

by Graf Zahl » Wed Mar 25, 2020 1:17 am

g_sin and g_sindeg are the ones that should be used, depending on what value range the angle is in.

Re: liquid warping effect not working

by drfrag » Tue Mar 24, 2020 3:58 pm

There are a lot of them: sin, g_sin, fastsin, c_sin...

Re: liquid warping effect not working

by Graf Zahl » Tue Mar 24, 2020 2:18 pm

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

Top