Texture/shader sorting

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Texture/shader sorting

Post 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?
Noruen
Posts: 308
Joined: Thu Jan 28, 2010 11:45 pm

Re: Texture/shader sorting

Post by Noruen »

Use "sort" parameter in shader it should help.
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Texture/shader sorting

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Texture/shader sorting

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Texture/shader sorting

Post by dONKEY »

Thanks. Sort 11 fixed my issues.
Post Reply