Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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