A lil informative game.
Guess and tell me how you think I made it, and I'll post the code/test package
Volumetric lightcones
- Shadow
- Masterful
- Posts: 743
- Joined: Tue Jan 29, 2008 12:00 am
- Personal rank: Mad Carpenter
- Location: Germany
- Contact:
Re: Volumetric lightcones
You're letting some sprite actors to be rendered on a line, like 32 sprites for each cone
Re: Volumetric lightcones
Exactly.Shadow wrote:You're letting some sprite actors to be rendered on a line, like 32 sprites for each cone
I had a few inconvenients calibrating the distances and 2D 'expansion' the sprites had, giving a weird cone.
But it worked after a few arbitrary adjustments (no theoretics at all, but worked).
The sprites are created in runtime except for the master sprite.
The master sprite holds the normalized direction the new sprites should go, as well as the amount of child sprites, and target size/darken should be.
The child sprites inherit the master sprite's texture and style... but with some nice randomized hardcoded water/ice textures, a nice fog effect inside the cones can be simulated.
Code: Select all
//=============================================================================
// FV_ConeMaker.
//=============================================================================
class FV_ConeMaker expands Decoration;
var() int Cones;
var() float FinalMult; //Final Scale multiplier (glow divisor)
var() vector Dir; //Normal of dir to spawn shit
var() float TotalDist;
var float FinalGScale;
var float FinalDScale;
simulated event PostBeginPlay()
{
local int i;
local float alpha, fFactor, fCur;
local FV_ModuParticle curM;
if ( Level.NetMode == NM_DedicatedServer )
return;
FinalDScale = DrawScale * FinalMult;
FinalGScale = (ScaleGlow / FinalMult);
FinalGScale = ((FinalGScale * 3 + ScaleGlow) / 4) - FinalGScale; //Preserve some light scale
Dir = Normal(Dir);
fFactor = (1.3 ** (1+FinalMult) ) - 1.3;
While ( i<Cones )
{
i++;
alpha = ((1.3 ** (1+(FinalMult * i / Cones))) - 1.3 ) / fFactor;
curM = Spawn( class'FV_ModuParticle',,, Location + Dir * TotalDist * Alpha);
curM.DrawScale = DrawScale + (FinalDScale - DrawScale) * Alpha;
curM.ScaleGlow = ScaleGlow + (FinalGScale - ScaleGlow) * Alpha;
curM.Style = Style;
curM.bUnlit = bUnlit;
curM.AmbientGlow = AmbientGlow;
curM.Texture = Texture;
}
}
EDIT:
Base values for the screenshot:
Texture = Texture'XFX.inoxxy'
Style = STY_Translucent
DrawScale = 0.300000
ScaleGlow = 0.200000
bUnlit = False (should be true... well)
Cones = 15
Dir = (Z=-1) and (Z=1)
FinalMult = 5.000000
TotalDist = 600.000000
- papercoffee
- Godlike
- Posts: 10453
- Joined: Wed Jul 15, 2009 11:36 am
- Personal rank: coffee addicted !!!
- Location: Cologne, the city with the big cathedral.
- Contact:
Re: Volumetric lightcones
Well, ideally you should really embed this into maps in order to allow better customization and networking (1 less package).
Which is how I actually did it.
If somebody had some nice ICE/WATER textures with some distortion on them, a very cool fog effect might come out of it.
I'll have a U package tomorrow...
Some more eye candy:
Which is how I actually did it.
If somebody had some nice ICE/WATER textures with some distortion on them, a very cool fog effect might come out of it.
I'll have a U package tomorrow...
Some more eye candy:
Re: Volumetric lightcones
Opps, I forgot about the particle class:
There, subclassing effects sets automatically RemoteRole to ROLE_None.
Code: Select all
class FV_ModuParticle expands Effects;
defaultproperties
{
DrawType=DT_Sprite
}
- Creavion
- Godlike
- Posts: 4497
- Joined: Sun Feb 17, 2008 7:23 pm
- Personal rank: About to be non-act.
- Location: Germany, Lower Saxony
Re: Volumetric lightcones
Too sad, nice stuff like this "always" comes too late.
About to be non-active
My very last UT map project: CTF-FacePalm (tropical CTF-Face remake)
Why do I leave? click here
What I want to do next: Joining an UDK team (uncertain however) and improve 3D modelling and texture editing skills
Thanks to those who visibly supported me until/at the end!
My reactivated account on indiedb.com.
My very last UT map project: CTF-FacePalm (tropical CTF-Face remake)
Why do I leave? click here
What I want to do next: Joining an UDK team (uncertain however) and improve 3D modelling and texture editing skills
Thanks to those who visibly supported me until/at the end!
My reactivated account on indiedb.com.