liquid warping effect not working
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.
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.
Re: liquid warping effect not working
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.
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: liquid warping effect not working
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: liquid warping effect not working
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
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: liquid warping effect not working
There are a lot of them: sin, g_sin, fastsin, c_sin...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: liquid warping effect not working
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
Thanks.drfrag wrote:It's pretty much the same, i edited BD to test it.
Re: liquid warping effect not working
What are the range limits?Graf Zahl wrote:g_sin and g_sindeg are the ones that should be used, depending on what value range the angle is in.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: liquid warping effect not working
None, save for precision related issues once the numbers get too large to represent all the fractional digits.
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: liquid warping effect not working
Isn't g_sindeg for radians?
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: liquid warping effect not working
I've tried with g_sin and i can't tell the difference.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: liquid warping effect not working
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.drfrag wrote:Isn't g_sindeg for radians?
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: liquid warping effect not working
I don't know but with g_sindeg the effect doesn't work.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: liquid warping effect not working
Of course not, the code was written for radians.
Re: liquid warping effect not working
drfrag do you know what Radians are?drfrag wrote:I don't know but with g_sindeg the effect doesn't work.
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.
- drfrag
- Vintage GZDoom Developer
- Posts: 3141
- Joined: Fri Apr 23, 2004 3:51 am
- Location: Spain
- Contact:
Re: liquid warping effect not working
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.
Anyway it seems it's not worth changing it, do you see any difference? I don't.