Re: rand() pattern in texture?
From: codemagic (codemagic_at_gmail.com)
Date: 10/13/04
- Next message: Will Twentyman: "Re: Division by zero. Go ahead and laugh."
- Previous message: Will Twentyman: "Re: Division by zero. Go ahead and laugh."
- In reply to: John M. Gamble: "Re: rand() pattern in texture?"
- Next in thread: The Ghost In The Machine: "Re: rand() pattern in texture?"
- Messages sorted by: [ date ] [ thread ]
Date: 13 Oct 2004 04:52:13 -0700
I attempted to reply before but google groups beta messed up somewhere.
oh well.
Anyway, after more investigation i determined the following:
1. using the high order bits of the result of rand() does indeed remove
the anomaly. Thanks all!
2. I notice that the anomaly only occurs (or is obvious) with rand() %
c if c is a power of 2. Maybe this is related to the texture being a
power of 2 in size? Example: rand() % 7 fine, rand() % 8 horrible.
3. rand() % 2 looks kinda random, certainly not 1, 0, 1, 0, 1, 0... the
win32 implementation has probably been improved at some stage.
Cheers,
Tom
- Next message: Will Twentyman: "Re: Division by zero. Go ahead and laugh."
- Previous message: Will Twentyman: "Re: Division by zero. Go ahead and laugh."
- In reply to: John M. Gamble: "Re: rand() pattern in texture?"
- Next in thread: The Ghost In The Machine: "Re: rand() pattern in texture?"
- Messages sorted by: [ date ] [ thread ]