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
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 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
Can one compare a value to zero? #98079
11/09/06 03:12
11/09/06 03:12
Joined: Oct 2003
Posts: 49
D
dirkmittler Offline OP
Newbie
dirkmittler  Offline OP
Newbie
D

Joined: Oct 2003
Posts: 49
I'm sorry if this question seems naive. I don't have much experience with fx files. But I'm writing a programmed shader, in which I need to determine at run-time, if the value of r0 equals zero.

If so, I'd appreciate an output of -1 or something like that, REGARDLESS of what r0 used to be.

Is there an asm instruction I failed to look up?

Dirk

Re: Can one compare a value to zero? [Re: dirkmittler] #98080
11/09/06 07:33
11/09/06 07:33
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
use HLSL!


Sphere Engine--the premier A6 graphics plugin.
Re: Can one compare a value to zero? [Re: dirkmittler] #98081
11/09/06 08:06
11/09/06 08:06
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
look here

search the site by "cmp" there is an example showing how to do branching if a value is 0.0


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