Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (fogman, Grant, AndrewAMD, juanex), 989 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Double Siding Shaders that Work with Transparency #25020
04/03/04 12:55
04/03/04 12:55
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Is there any way to make a shader that double sides polygons work with transparency? If I try it on the shaders I have now it looks aweful because you can see the inside polygons.

I tried this work around, since the parts that are double sided are not in view when the camera is up close. When the camera is close I turn the material off and transparency on, just while the camera is in close range:

Code:

if(actual_dist_from_player > 0 && actual_dist_from_player < 100)
{
my.material = null;
my.transparent = on;
my.transparent = actual_dist_from_player;
}else
{ if (my.material==null)
{
my.transparent=off;
my.material = mtl_doublesided;
}

}



However this causes the engine to crash (not just an error, the whole window folds).

EDIT> That should have been my.alpha = actual_dist_from_player, but anyway, it is setting the material to null that causes the crash.





Last edited by A.Russell; 04/03/04 13:27.
Re: Double Siding Shaders that Work with Transpare [Re: A.Russell] #25021
04/03/04 13:49
04/03/04 13:49
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Setting my.material = null is bad... very bad. Set it to one of the defaults, like mat_model, etc.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Double Siding Shaders that Work with Transpare [Re: qwerty823] #25022
04/03/04 15:52
04/03/04 15:52
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan


Thank you qwerty.


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1