[1.9] Particle system displayed as ugly quads

Problems building or running the engine, queries about how to use features etc.
Post Reply
jho
Gnoblar
Posts: 5
Joined: Thu Apr 07, 2016 10:26 am

[1.9] Particle system displayed as ugly quads

Post by jho » Fri Apr 29, 2016 8:47 pm

Hi, Ogre folks!

I'm a noob here, I hope I respect the way of posting.

My problem is the following:
1. I played with the Ogre Particle Lab, and I saved (actually copied) a particle system (the one called "cross")
2. I put the .particle, referenced .material and img texture in my Resource directory
3. When I load the particle system, I get something ressembling the original, but seems to miss the material / texture.

I tried some variations, but no success.

The rendered scene is here:

http://imgur.com/QHbPoKB

The C++ code is the following:

Code: Select all

​        // Set Ambient Light
	mSceneMgr->setAmbientLight(Ogre::ColourValue(0, 0, 0));
	mSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);

	// Skybox
	//mSceneMgr->setSkyBox(true, SKYBOX, SKYBOXDISTANCE);

	// Main light
	Ogre::Light* light = mSceneMgr->createLight("MainLight");

	// Sandbox
	Ogre::ParticleSystem* sunParticle = mSceneMgr->createParticleSystem("Cross", "Cross");
	Ogre::SceneNode* particleNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("Particle");
	particleNode->attachObject(sunParticle);

	// sandbox
	return;
Grepping the log shows the relevant lines:

Code: Select all

Parsing script Bump.particle
Parsing script Cross.particle
...
Parsing script Myparticlesun.particle
...
​Parsing script Flare.000.material​
The particle and material files:

Code: Select all

particle_system Cross
{
	material Flare
	particle_width 152.940002441406
	particle_height 154.119995117188
	quota 2000
	cull_each false
	sorted false
	local_space false
	iteration_interval 0.0
	nonvisible_update_timeout 0.0
	billboard_type point
	billboard_origin center
	billboard_rotation_type texcoord
	point_rendering false
	accurate_facing false

	emitter Point
	{
		position 0.0 0.0 0.0
		direction 1.0 0.0 0.0
		angle 0
		emission_rate 200
		velocity_min -1000
		velocity_max 1000
		time_to_live_min 3
		time_to_live_max 3
		duration_min 0
		duration_max 0
		repeat_delay_min 0
		repeat_delay_max 0
		colour_range_start 1 1 1 1
		colour_range_end 0.666667 0 0 1
	}

	emitter Point
	{
		position 0.0 0.0 0.0
		direction 0.0 0.0 1.0
		angle 0
		emission_rate 200
		velocity_min -1000
		velocity_max 1000
		time_to_live_min 3
		time_to_live_max 3
		duration_min 0
		duration_max 0
		repeat_delay_min 0
		repeat_delay_max 0
		colour_range_start 1 1 1 1
		colour_range_end 0.333333 0 1 1
	}

	emitter Point
	{
		position 0.0 0.0 0.0
		direction 0.0 1.0 0.0
		angle 0
		emission_rate 200
		velocity_min -1000
		velocity_max 1000
		time_to_live_min 3
		time_to_live_max 3
		duration_min 0
		duration_max 0
		repeat_delay_min 0
		repeat_delay_max 0
		colour_range_start 1 1 1 1
		colour_range_end 0 1 0.498039 1
	}

	affector LinearForce
	{
		force_vector 0.0 -45.62 0.0
		force_application add
	}

	affector Scaler
	{
		rate 16.47
	}
}
​

​/////

material Flare
{
	technique
	{
		pass
		{
			lighting off
			depth_write off
			scene_blend add

			texture_unit
			{
				Flare.000.png
			}
		}
	}
}
And the texture is correctly located in the ressources folder

Code: Select all

C:\OGRE\bin\Resources>dir Flare.000.png
 Volume in drive C is OS
 Volume Serial Number is A206-B642

 Directory of C:\OGRE\bin\Resources

11/24/2010  08:54 PM            27,754 Flare.000.png
               1 File(s)         27,754 bytes​
Any clue where the problem is?

Many thanks,

Julien
0 x

User avatar
areay
Bugbear
Posts: 818
Joined: Wed May 05, 2010 4:59 am
Location: Auckland, NZ

Re: [1.9] Particle system displayed as ugly quads

Post by areay » Sat Apr 30, 2016 10:34 am

It'd be good to see what your Flare.000.png is looking like. Does it have an alpha channel? If so you should/could use 'scene_blend alpha_blend'.

You're using scene_blend add at the moment and what I thing is happening is that you're spawning so many billboards that they are all overlapping and adding themselves to saturate the colour as white.

So, decrease your emission rate, change your scene_blend mode (maybe) and try again :)
0 x

jho
Gnoblar
Posts: 5
Joined: Thu Apr 07, 2016 10:26 am

Re: [1.9] Particle system displayed as ugly quads

Post by jho » Sat Apr 30, 2016 11:23 am

Hi areay,

Thanks for your help.
It'd be good to see what your Flare.000.png is looking like. Does it have an alpha channel?
--> Here, posted new render after changes, and the flare currently used.
http://imgur.com/a/pOEzS

It has transparency.
So, decrease your emission rate, change your scene_blend mode (maybe) and try again
--> OK, tried with

Code: Select all

scene_blend alpha_blend //in the material, 
and 
emission_rate 20 //in the particle script.
The render is a bit different, but still squares :(
0 x

User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2702
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 1

Re: [1.9] Particle system displayed as ugly quads

Post by syedhs » Tue May 03, 2016 10:22 am

Maybe put in fog_override in the material will solve it? Or trying turning off fog first.
0 x
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me

Post Reply