Does render order affect EMT_TRANSPARENT_ADD_COLOR ?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Does render order affect EMT_TRANSPARENT_ADD_COLOR ?

Post by Warchief »

Hi,

lets say i have 1 particle system with EMT_TRANSPARENT_ADD_COLOR as material type. Lets say its rendered over a EMT_TRANSPARENT_ALPHA_CHANNEL material.

At certain angles of the camera, the render is done different. It seems to be a problem with render order, but dont know if it is expected to be like that.

Check the images:

ImageImage

The one on the right is darker, maybe the red hexagon is added to the color; but the one on the left is bright as the sun. They are done just by rotating the camera.

Any advice would be of help.
Thanks.
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Up.
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

-- Repeated Message --
Last edited by Warchief on Thu Feb 23, 2006 9:17 am, edited 1 time in total.
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

-- Repeated Message --
Last edited by Warchief on Thu Feb 23, 2006 9:17 am, edited 1 time in total.
Guest

Post by Guest »

do you think you get answes when bumping the thread 3 times? post some code or tell us more details
burivuh
Posts: 30
Joined: Tue Nov 22, 2005 1:22 pm

Re: Does render order affect EMT_TRANSPARENT_ADD_COLOR ?

Post by burivuh »

Warchief wrote:Hi,

lets say i have 1 particle system with EMT_TRANSPARENT_ADD_COLOR as material type. Lets say its rendered over a EMT_TRANSPARENT_ALPHA_CHANNEL material.

At certain angles of the camera, the render is done different. It seems to be a problem with render order, but dont know if it is expected to be like that.

The one on the right is darker, maybe the red hexagon is added to the color; but the one on the left is bright as the sun. They are done just by rotating the camera.

Any advice would be of help.
Thanks.
If you have more than one type of transparent material - try to use only one type with identical params for no changing render states while transparent objects are drawn
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Anonymous wrote:do you think you get answes when bumping the thread 3 times? post some code or tell us more details
When i posted them i got an error for each one (SQL blah blah), so i thought none of the messages above were posted. (I thought it was because i was writing just 1 word, so i added another "up" the last post"). Sorry for the three posts, just wanted one to refresh the thread.
burivuh wrote:If you have more than one type of transparent material - try to use only one type with identical params for no changing render states while transparent objects are drawn
Do you mean different nodes with transparent materials?
Cell is a Lightmap material.
Red plane is a Trans_Alpha_Channel material.
Ring PS is a Trans_Add_Color material.

Should i use Trans_Alpha for the PS too?


Thanks.


PS: btw i have no code here, will post it later if needed.
burivuh
Posts: 30
Joined: Tue Nov 22, 2005 1:22 pm

Post by burivuh »

Warchief wrote: Do you mean different nodes with transparent materials?
Cell is a Lightmap material.
Red plane is a Trans_Alpha_Channel material.
Ring PS is a Trans_Add_Color material.

Should i use Trans_Alpha for the PS too?
Yes, use only trans_alpha or only trans_add_color.
I mean, that using one type of trans material with the same params (important!) will lead for only one render states changing (when first trans node will be rendered), after this all other trans nodes will not change render states when they'll be drawn (because they will have the same SMaterial struct data).

If it will help - you must write bug report about bad render states changing with rendering trans materials
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

As you suggested, the same material do the trick (at least setting both to additive), although it is not the desired solution.

Thanks for the tip.

Head to report:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=68929
Ced666
Posts: 86
Joined: Fri Jan 13, 2006 10:29 am
Location: Belgium

Post by Ced666 »

Warchief, I have a question: I was looking for a way of selecting my units by using the particle system (something nice would be to have particles turning around the unit). I saw that you use a kind of similar principle. How did you do that ? You manage the movement of each particle yourself ?

Thanks for your reply.
Warchief
Posts: 204
Joined: Tue Nov 22, 2005 10:58 am

Post by Warchief »

Ced666 wrote:Warchief, I have a question: I was looking for a way of selecting my units by using the particle system (something nice would be to have particles turning around the unit). I saw that you use a kind of similar principle. How did you do that ? You manage the movement of each particle yourself ?
Thanks for your reply.
Take a look at SpecialFX demo at Spintz mod, if you press F1 you will see the help. Click number 3 and you will see 2 rings rotating in opposite direction:

Image

It is a new emitter RingEmitter. Its exactly what u need.
Post Reply