[Fixed] liquid warping effect not working

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Re: liquid warping effect not working

Postby Rachael » Tue Mar 24, 2020 12:50 pm

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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: liquid warping effect not working

Postby drfrag » Tue Mar 24, 2020 1:35 pm

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
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: liquid warping effect not working

Postby 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
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: liquid warping effect not working

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

There are a lot of them: sin, g_sin, fastsin, c_sin...
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: liquid warping effect not working

Postby 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: liquid warping effect not working

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

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

Thanks.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: liquid warping effect not working

Postby 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?
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: liquid warping effect not working

Postby 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: liquid warping effect not working

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

Isn't g_sindeg for radians?
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: liquid warping effect not working

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

I've tried with g_sin and i can't tell the difference.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: liquid warping effect not working

Postby 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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: liquid warping effect not working

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

I don't know but with g_sindeg the effect doesn't work.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: liquid warping effect not working

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

Of course not, the code was written for radians.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: liquid warping effect not working

Postby 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.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: liquid warping effect not working

Postby 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.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

PreviousNext

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest