Page 1 of 1

Texture/shader sorting

Posted: Mon Jul 02, 2012 10:06 am
by dONKEY
First off, sorry I can't post my scripts right now, as I wont be home for awhile.
I have run into a little problem.
I have water falling from a pipe over a walkway and into the sea.
If the player looks up, my glass shader in some of the grometry above is being drawn over the water. If the player looks at the water, my water shader is being drawn over the base of the waterfall and the splash sprites I created.
I guess it would be a lot easier if I could just post the shaders, but in the mean time is there any general advice on how to set up the waterfall script so it gets drawn ontop of everything else?

Re: Texture/shader sorting

Posted: Mon Jul 02, 2012 11:23 am
by Noruen
Use "sort" parameter in shader it should help.

Re: Texture/shader sorting

Posted: Mon Jul 02, 2012 11:40 am
by dONKEY
I have sort 6 in the waterfall shader, should I try adding a lower value in the other shaders? Not really clear how it works.

Re: Texture/shader sorting

Posted: Mon Jul 02, 2012 2:09 pm
by obsidian
Higher sort values means it will be drawn closer to the player. Assuming both shaders are using blendFunc blend, then you should be trying a higher sort value - maybe sort 10.

Re: Texture/shader sorting

Posted: Mon Jul 02, 2012 11:57 pm
by dONKEY
Thanks. Sort 11 fixed my issues.