Spawner interpolation

17 views
Skip to first unread message

iarwain

unread,
Jul 21, 2015, 8:03:16 AM7/21/15
to orx...@googlegroups.com
Hi all,

Following a request recently made by Lydesik, I just implemented spawner "sub-frame" interpolation.

What that means is that, when your spawner's wave delay is much shorted than the actual framerate, the spawner will try to spawn objects "back in time", using a linear interpolation.
This results in much smoother display of particles in the case of fast moving spawners, but also in more objects spawner, which might affect your performances.

The feature is turned on by default and can be turned off using a config property:

[MySpawner]
Interpolate = false

NB: The interpolation will also happen in the case where your wave delay doesn't match your actual framerate. If that triggers some artefacts for you, simply turn the interpolation off on your spawner.

To have a more visual example of what the feature actually is, simply sync the mercurial repository and compile orx.
Then paste the lines at the end of the email to the beginning of BounceAlt.ini.

Finally start orx in /code/bin. You can now see the difference between the two modes by changing the line

[TestSpawner]
Interpolate = true

The fast moving red dot is where the spawner is located every frame, when it spawns objects. The yellow squares are the spawned particles.

Lemme know if you have any questions!

Cheers,

Rom


---

[WallTrack]
0 = Object.Create RotatingParent

[Wall1]
Group = dummy
Scale = (-1, 1, 1)
[WallGraphic]
Pivot = top left

[Wall2]
Group = dummy

[Wall3]
Group = dummy

[Wall4]
Group = dummy

[ParticleSource]
Group = dummy

[Particle]
Group = dummy

[RotatingParent]
ChildList = RotatingChild
AngularVelocity = 1000

[RotatingChild]
Spawner   = TestSpawner
Position  = (-150, 0, 0)
Graphic   = @
Texture   = pixel
Pivot     = center
Color     = (255, 0, 0)
Scale     = 2

[TestSpawner]
Interpolate = true
WaveDelay = 0.002
WaveSize  = 1
Object    = TestParticle
ObjectSpeed = (-100, 0, 0)
UseRelativeSpeed = true

[TestParticle]
Graphic   = @
Pivot     = center
Texture   = pixel
Color     = (255, 255, 0)
LifeTime  = 0.5
Scale     = 2
Position  = (-10, 0, 0) ;(-12, -2, 0) ~ (-8, 2, 0)
FXList    = FadeOut2

[FadeOut2@FadeOut]
SlotList  = AlphaFadeOut2

[AlphaFadeOut2@AlphaFadeOut]
EndTime   = @TestParticle.LifeTime


--

PS: Sorry for the double post, not exactly sure what happened there.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages