[2.1] Particle appearance is messed up

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
xissburg
Halfling
Posts: 83
Joined: Sun Feb 21, 2010 4:58 pm
x 28

[2.1] Particle appearance is messed up

Post by xissburg »

I have already spent a lot of time trying many different things but I keep getting this noisy blue result with a basic particle system:

Image

This is the particle system:

Code: Select all

particle_system Smoke
{
	material        	Smoke
	particle_width  	0.01
	particle_height 	0.01
	cull_each       	true
	quota           	400
	billboard_type  	point
	sorted				true
    
	// Area emitter
	emitter Point
	{
		position 0 0 0
		angle 35
		emission_rate 1
		time_to_live 6
		direction 0 1 0
		velocity_min 0.2
		velocity_max 1
        	duration 4
	}

   	affector Rotator
   	{
		rotation_range_start 0
		rotation_range_end 360
		rotation_speed_range_start -60
		rotation_speed_range_end 200
   	}

   	affector Scaler
   	{
       	rate 1.4
   	}

}
Has anybody ever seen a similar issue? Any hints? This seems like something broken more deep down the render pipeline, maybe. I'm using Metal btw. I tried using the OpenGL3+ render system as well and the billboards appear completely black.

Thanks
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] Particle appearance is messed up

Post by al2950 »

can you post the material 'smoke' you are using
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: [2.1] Particle appearance is messed up

Post by xrgo »

seems like a missing/faulty/invalidFormat texture
xissburg
Halfling
Posts: 83
Joined: Sun Feb 21, 2010 4:58 pm
x 28

Re: [2.1] Particle appearance is messed up

Post by xissburg »

al2950 wrote: Mon Oct 15, 2018 7:29 pm can you post the material 'smoke' you are using
The material seems irrelevant since any of them gives the same result. Anyways here it is:
"Smoke": {
"diffuse": {
"texture": "smoke.png",
"sampler": "LinearSampler"
},

"specular": {
"value": [0.3, 0.3, 0.3]
},

"roughness": {
"value": 0.4
},

"transparency" : {
"mode" : "Fade",
"use_alpha_from_textures" : true
}
}
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: [2.1] Particle appearance is messed up

Post by xrgo »

is that a pbs material? I think that particles just works with unlit datablocks
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: [2.1] Particle appearance is messed up

Post by dark_sylinc »

xrgo is right. The current particle system does not generate normals, which is required by the PBS system to work correctly. There's probably a lot of warnings and errors in Ogre.log about that.

Use Unlit materials and that should fix it.
xissburg
Halfling
Posts: 83
Joined: Sun Feb 21, 2010 4:58 pm
x 28

Re: [2.1] Particle appearance is messed up

Post by xissburg »

Yeah that was right. I'm using this now:

Code: Select all

{
	"samplers": {
		"LinearSamplerBorder": {
            		"min": "linear",
			"mag": "linear",
			"mip": "linear",
			"u": "border",
			"v": "border",
			"w": "border",
			"border" : [1, 1, 1, 0]
        	}
        },
	"blendblocks": {
		"SmokeBlend": {
			"alpha_to_coverage": false,
			"src_blend_factor": "src_alpha",
			"dst_blend_factor": "one_minus_src_alpha"
		}
	},
	"unlit": {
		"Smoke": {
			"diffuse_map0": {
				"texture": "smoke.png",
				"sampler": "LinearSamplerBorder"
			},
			"blendblock": "SmokeBlend"
		}
	}
}
I had to dig deep into the source code to figure out how to setup this unlit material json since I couldn't find any docs or examples.

Thanks guys
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

Re: [2.1] Particle appearance is messed up

Post by rujialiu »

xissburg wrote: Tue Oct 16, 2018 6:38 pm I had to dig deep into the source code to figure out how to setup this unlit material json since I couldn't find any docs or examples.
You can improve the docs and make a PR :) or edit the wiki?
xissburg
Halfling
Posts: 83
Joined: Sun Feb 21, 2010 4:58 pm
x 28

Re: [2.1] Particle appearance is messed up

Post by xissburg »

rujialiu wrote: Thu Oct 18, 2018 4:13 pm
xissburg wrote: Tue Oct 16, 2018 6:38 pm I had to dig deep into the source code to figure out how to setup this unlit material json since I couldn't find any docs or examples.
You can improve the docs and make a PR :) or edit the wiki?
Yeah I probably should :)
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: [2.1] Particle appearance is messed up

Post by dark_sylinc »

PRs are welcomed. There should be an example material in Docs/2.0/JSON but there is none for Unlit currently.

A cheap trick to get an example for you is to create one via C++ in a random sample linking against HlmsUnlit (like AreaApproxLights, Decals, ShadowMapDebuggin) and export it to JSON via HlmsManager::saveMaterial:

Code: Select all

Ogre::HlmsMacroblock macroblock;
Ogre::HlmsBlendblock blendblock;
Ogre::HlmsParamVec params;
Ogre::HlmsDatablock *datablock = hlmsUnlit->createDatablock( "DebugDecalMat", "DebugDecalMat", macroblock, blendblock, params );
Ogre::HlmsUnlitDatablock *unlitDatablock = static_cast<Ogre::HlmsUnlitDatablock*>( datablock );//Do what you want with unlitDatablock
hlmsManager->saveMaterial( datablock, "path/to/filename.material.json", 0, "" );
xissburg
Halfling
Posts: 83
Joined: Sun Feb 21, 2010 4:58 pm
x 28

Re: [2.1] Particle appearance is messed up

Post by xissburg »

Well after hours failing to get the samples to build correctly on macOS so that I could write my own I will have to give up for now ¯\_(ツ)_/¯. I might try again later when I get my sanity back lol.
Post Reply