Jump to content

Emitter


AndyGFX
 Share

Recommended Posts

I have used same code for two emitters, difference is only in parameter CYCLEMODE, but result looks like bug, because Emitter position is moved in Velocity vector too, when is cyclemode set to 1. Is it bug? (From my point of view - yes) but I waiting for confirmation from others. Then i write bug to bugtracker, when yes.

 


Function Fire()

Local particle:TEmitter

setWorld(fw.transparency.world)

	particle = CreateEmitter(80, 500, Vec3(0, 4, 0), 0)

	particle.SetPosition(Vec3(-1, 0, 0))
	particle.SetRotation(Vec3(0, 0, 0))
	EntityColor(particle, Vec4(1, 0.5, 0.25, 0.5))
	PaintEntity(particle, LoadMaterial("abstract::fire.mat"))
	SetEmitterRadius(particle, 0.1, 0.5)
	SetEmitterRotationSpeed(particle, 0.2)

setWorld(fw.Main.world)


Local particle2:TEmitter

setWorld(fw.transparency.world)

	particle2 = CreateEmitter(80, 500, Vec3(0, 4, 0), 1)

	particle2.SetPosition(Vec3(1, 0, 0))
	particle2.SetRotation(Vec3(0, 0, 0))
	EntityColor(particle2, Vec4(1, 0.5, 0.25, 0.5))
	PaintEntity(particle2, LoadMaterial("abstract::fire.mat"))
	SetEmitterRadius(particle2, 0.1, 0.5)
	SetEmitterRotationSpeed(particle2, 0.2)				

setWorld(fw.Main.world)

End Function

 

emitter.png

[HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64

[sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx

 

76561197970156808.pngAndyGFX.png

Link to comment
Share on other sites

  • 1 month later...
Guest Red Ocktober

also, in the editor in 2.32R i get this...

 

 

 

LW_Editor%20Particles%20Bug.jpg

 

 

 

 

(reported in bug tracker)

 

 

--Mike

Link to comment
Share on other sites

Hi Andy,

Your 2nd emitter doesn't show at all on my machine with latest Leadwerks 2.32. Only when I set cyclemode=0 it shows.

 

It doesn't show because its a one-shot when cyclemode is set to a 1 and it would already do the oneshot emitter by the time the game loads completely. You would have to set it up to only display say when you hit a key to see it.

 

I don't know Andy... it appears to be doing exactly what its being telling to do... the only thing that seems strange is that the oneshot emitter seems brighter than the continuous emitter

 

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

The "seems brighter" is, because all 80 particles are created on same place, and for this I think, that is bug.

[HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64

[sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx

 

76561197970156808.pngAndyGFX.png

Link to comment
Share on other sites

The "seems brighter" is, because all 80 particles are created on same place, and for this I think, that is bug.

 

ah good point... looks like the continuous emitter when the number of particles are set to 1 ;)

 

so... i guess i am confused... what are you suggesting is the problem? the fact that the oneshot emitter does all 80 particles at the same time?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Try change alpha color to 0.0125 with 80 particles, and then same alpha with only one particle.

 

 

particle2 = CreateEmitter(80, 500, Vec3(0, 4, 0), 1)

EntityColor(particle2, Vec4(1, 0.5, 0.25, 0.0125))

 

 

particle2 = CreateEmitter(1, 500, Vec3(0, 4, 0), 1)

EntityColor(particle2, Vec4(1, 0.5, 0.25, 0.0125))

 

Edit:

 

Because emitter is moved in same velocity as is defined for particles nodes, then all new particles are created on actual node position and sum of all alpha is >1 => without transparency.

[HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64

[sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx

 

76561197970156808.pngAndyGFX.png

Link to comment
Share on other sites

Guest Red Ocktober

this is what i'm getting with the default emitter... with a lil yellow color...

 

see how the particles are darker when they pass in front of terrain...

 

in 2.31 all was well with this...

 

[edit]

 

added a shot of same emitter in 2.31 (bottom right)... issue not present back then...

 

 

--Mike

post-65-12753342023246_thumb.jpg

post-65-12753346662185_thumb.jpg

Link to comment
Share on other sites

Second strange thing is, why bullet.lua with cyclemode=1 works (is used in fpscontroller.lua).

 

...

if pick~=nil then
			SetWorld(fw.transparency.world)
			emitter=CreateEmitter(5,700,pick.normal,1)
			emitter:SetVelocity( pick.normal )
			emitter:SetRadius(0.1,0.5)
			emitter:SetWaver(10)
			emitter:SetColorf(0.5,0.5,0.5,0.1)
			emitter:Paint(material_impactdust)
			emitter:SetPosition( pick.position )
			emitter:SetRotationSpeed(0.1)
			SetWorld(fw.main.world)
...

 

Note: Looks like for Lua LE API is this issue fixed.

[HW] C2D Q6600, 4GB RAM, NV8800GTX, Vista Ultimate x64

[sW] Blide Plus, BlitzMax, Delphi, C++, 3DWS 5.53, Leadwerks 2.xx

 

76561197970156808.pngAndyGFX.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...