Shader writers: Please don't use frac() in shader code

Shader writers: Please don't use frac() in shader code

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Shader writers: Please don't use frac() in shader code

Post by imbaczek »

Use fract() instead. frac() doesn't exist on ATIs.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Shader writers: Please don't use frac() in shader code

Post by Argh »

I will check the LUPS module.

<checks>

It's clean.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: Shader writers: Please don't use frac() in shader code

Post by Caydr »

Searched the entire contents of CA, no references to frac. I guess the problem's not too widespread.

Code: Select all

Find 'fract(' in 'CA\lups\ParticleClasses\SimpleParticles.lua':
CA\lups\ParticleClasses\SimpleParticles.lua(234):
           gl_FrontColor = mix(colormap[ipos1],colormap[ipos2],fract(cpos));
Found 'fract(' 1 time(s).
----------------------------------------
Find 'fract(' in 'CA\lups\ParticleClasses\SimpleParticles2.lua':
CA\lups\ParticleClasses\SimpleParticles2.lua(238):
            gl_FrontColor = mix(colormap[ipos1], colormap[ipos2], fract(cpos));
Found 'fract(' 1 time(s).
----------------------------------------
Find 'fract(' in CA\lups\ParticleClasses\StaticParticles.lua':
CA\lups\ParticleClasses\StaticParticles.lua(178):
            gl_FrontColor = mix(colormap[ipos1],colormap[ipos2],fract(cpos));
Found 'fract(' 1 time(s).
Search complete, found 'fract(' 3 time(s). (3 file(s)).
BA does use it once though:

Code: Select all

Find 'frac(' in 'BA\lups\ParticleClasses\ThundAirJet.lua':
BA\lups\ParticleClasses\ThundAirJet.lua(149):
           gl_FragColor.rgb += pow(opac,frac(timer*70.0)+6.0);           //white flame
Found 'frac(' 1 time(s).
Search complete, found 'frac(' 1 time(s). (1 file(s)).
Post Reply

Return to “Lua Scripts”