PointParticleRenderer ignores pointSize?

Hi pandas! :smiley:

I’ve got a small problem with the PointParticleRenderer.
It seems to ignore the pointSize in all available panda versions.
I’ve tried the particlePanel sample in 1.7.2, 1.8.0 and the dev-version but the particles are always one pixel of size. (also tried it under linux and windows on different machines)

Am I missing something? The documentation is missing any docstrings and the manual says “Width and height of points, in pixels”.

greetz dskw

Hmm, you’re right–looking at the code, it doesn’t actually do anything with the point size parameter. This might be an old parameter that’s been deprecated and never removed for some reason; or maybe it was never implemented in the first place? I don’t remember ever using it.

In any case, you can set the point size using the NodePath interface: use renderParent.setRenderModeThickness(pointSize).

David

Hi David, thanks for your help!

Sadly that didn’t change the size of the points.
I’ve tried to set it on the renderParent as suggested, then on the effect node itself, with values of 1 and 100 but nothing changes.

My setup is described in this post:
[url][SOLVED] Sprite particles not rendered correctly]
(I’m switching between two saves of the ParticlePanel, one with points and the other with sprites)

I’ve tried the SpriteParticleRenderer there as an alternative, but I’d rather use the PointParticleRenderer as I guess it’s less resource intensive and fully sufficient for my desired effect.

-Andreas

The last answer on this topic was about 9 years ago. Unfortunately, it seems that despite the passage of years, PointParticleRenderer still ignores pointSize. I also tried to increase the point size with setRenderModeThickness but that doesn’t work either.
Do any of you know any solution to this problem? Of course, except for (workaround) using sprites.

This has always worked, the problem is that in the code itself it needs to be placed before a certain moment of initialization of the `PointParticleRenderer’ class.

The right example.

# Particles parameters
p0.setFactory("PointParticleFactory")
p0.setRenderer("PointParticleRenderer")
p0.renderer.setPointSize(10.00)
1 Like

Continuing this topic. The fountain.ptf effect from the particle example should look like this.

self.reset()
self.setPos(0.000, 0.000, 0.000)
self.setHpr(0.000, 0.000, 0.000)
self.setScale(2.000, 2.000, 2.000)
p0 = Particles.Particles('particles-1')
# Particles parameters
p0.setFactory("PointParticleFactory")
p0.setRenderer("PointParticleRenderer")
p0.renderer.setPointSize(3.00)
p0.setEmitter("DiscEmitter")
p0.setPoolSize(10000)
p0.setBirthRate(0.0200)
p0.setLitterSize(300)
p0.setLitterSpread(100)
p0.setSystemLifespan(0.0000)
p0.setLocalVelocityFlag(1)
p0.setSystemGrowsOlderFlag(0)
# Factory parameters
p0.factory.setLifespanBase(0.5000)
p0.factory.setLifespanSpread(0.2500)
p0.factory.setMassBase(2.0000)
p0.factory.setMassSpread(0.0100)
p0.factory.setTerminalVelocityBase(400.0000)
p0.factory.setTerminalVelocitySpread(0.0000)
# Point factory parameters
# Renderer parameters
p0.renderer.setAlphaMode(BaseParticleRenderer.PRALPHAOUT)
p0.renderer.setUserAlpha(0.45)
# Point parameters

p0.renderer.setStartColor(LVector4(0.25, 0.90, 1.00, 1.00))
p0.renderer.setEndColor(LVector4(1.00, 1.00, 1.00, 1.00))
p0.renderer.setBlendType(PointParticleRenderer.PPONECOLOR)
p0.renderer.setBlendMethod(BaseParticleRenderer.PPNOBLEND)
# Emitter parameters
p0.emitter.setEmissionType(BaseParticleEmitter.ETCUSTOM)
p0.emitter.setAmplitude(1.0000)
p0.emitter.setAmplitudeSpread(0.0000)
p0.emitter.setOffsetForce(LVector3(0.0000, 0.0000, 4.0000))
p0.emitter.setExplicitLaunchVector(LVector3(1.0000, 0.0000, 0.0000))
p0.emitter.setRadiateOrigin(LPoint3(0.0000, 0.0000, 0.0000))
# Disc parameters
p0.emitter.setRadius(0.0500)
p0.emitter.setOuterAngle(356.1859)
p0.emitter.setInnerAngle(0.0000)
p0.emitter.setOuterMagnitude(2.0000)
p0.emitter.setInnerMagnitude(1.0000)
p0.emitter.setCubicLerping(0)
self.addParticles(p0)
f0 = ForceGroup.ForceGroup('gravity')
# Force parameters
force0 = LinearVectorForce(LVector3(0.0000, 0.0000, -1.0000), 25.0000, 1)
force0.setActive(1)
f0.addForce(force0)
force1 = LinearJitterForce(3.0000, 1)
force1.setActive(1)
f0.addForce(force1)
self.addForceGroup(f0)
1 Like

Thank you! This definitively solved the problem! :slight_smile:

1 Like