[2.1] Particle appearance is messed up

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
xissburg
Halfling
Posts: 52
Joined: Sun Feb 21, 2010 4:58 pm
x 2

[2.1] Particle appearance is messed up

Post by xissburg » Mon Oct 15, 2018 7:24 pm

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
0 x

al2950
OGRE Expert User
OGRE Expert User
Posts: 1131
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 51

Re: [2.1] Particle appearance is messed up

Post by al2950 » Mon Oct 15, 2018 7:29 pm

can you post the material 'smoke' you are using
0 x

xrgo
OGRE Expert User
OGRE Expert User
Posts: 911
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 51

Re: [2.1] Particle appearance is messed up

Post by xrgo » Mon Oct 15, 2018 7:31 pm

seems like a missing/faulty/invalidFormat texture
0 x

xissburg
Halfling
Posts: 52
Joined: Sun Feb 21, 2010 4:58 pm
x 2

Re: [2.1] Particle appearance is messed up

Post by xissburg » Mon Oct 15, 2018 7:46 pm

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
}
}
0 x

xrgo
OGRE Expert User
OGRE Expert User
Posts: 911
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 51

Re: [2.1] Particle appearance is messed up

Post by xrgo » Mon Oct 15, 2018 8:15 pm

is that a pbs material? I think that particles just works with unlit datablocks
1 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3775
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 134
Contact:

Re: [2.1] Particle appearance is messed up

Post by dark_sylinc » Mon Oct 15, 2018 8:55 pm

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.
1 x

xissburg
Halfling
Posts: 52
Joined: Sun Feb 21, 2010 4:58 pm
x 2

Re: [2.1] Particle appearance is messed up

Post by xissburg » Tue Oct 16, 2018 6:38 pm

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
0 x

rujialiu
Greenskin
Posts: 136
Joined: Mon May 09, 2016 8:21 am
x 11

Re: [2.1] Particle appearance is messed up

Post by rujialiu » 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?
0 x

xissburg
Halfling
Posts: 52
Joined: Sun Feb 21, 2010 4:58 pm
x 2

Re: [2.1] Particle appearance is messed up

Post by xissburg » Thu Oct 18, 2018 4:44 pm

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 :)
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3775
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 134
Contact:

Re: [2.1] Particle appearance is messed up

Post by dark_sylinc » Thu Oct 18, 2018 5:06 pm

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, "" );
0 x

xissburg
Halfling
Posts: 52
Joined: Sun Feb 21, 2010 4:58 pm
x 2

Re: [2.1] Particle appearance is messed up

Post by xissburg » Fri Oct 19, 2018 1:24 am

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.
0 x

Post Reply