Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Help with Set Object Mask

Author
Message
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Dec 2010 01:26 Edited at: 23rd Dec 2010 01:56
Hello, I have a question about the Set Object Mask command.

I know how it works and all that, (For Example: 'Set Object Mask Obj, 2 ^ 0' will make the object visible to only camera 0) But Is there a way to set an object to be visible to multiple cameras?

I vaguely remember something like Set Object Mask Obj, 2^0||2^2 (or something, but it doesn't work as expected.)

Basically, I'm trying to combine a number of shaders into my game engine (Evolved's Fresnel water, 60 squares' heat haze, bond1's adaptive bloom) which works if I don't set the mask at all, it just looks weird when using the bloom. (I get multiple ghosts in the heat haze, but no bloom.) I can't figure out how to mask multiple cameras.

Can anyone assist? Much thanks anyway.

My signature is NOT a moderator plaything! Stop changing it!
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 23rd Dec 2010 02:05 Edited at: 23rd Dec 2010 02:05
Quote: "But Is there a way to set an object to be visible to multiple cameras?"

I could be wrong, but setting the Camera Mask Bits to the corresponding camera numbers should solve it?

From the help files:



Cheers

SLAYER RULES! YEAH, MAN!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Dec 2010 02:07
That only works if you know the camera number, and can convert it to Binary.

The system I use (I.E. the 2^CamNo) means I can use a Find Free Camera function to get the camera ID, but I need to be able to do it for two cameras, which could have any ID.

I was sure I could do some kind of bitwise jiggery pokery, but using the method I'm using, rather than have to convert the decimals into binary, then bitwise that.
(If that makes sense)

My signature is NOT a moderator plaything! Stop changing it!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2010 12:32
You already had it:

That should enable the object for camera 0 and 2.

You can see this by displaying the result in binary:


Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Dec 2010 12:37
Really? Thanks for that, but it doesn't seem to provide the desired results?

I'll have another fiddle with it and see what's what and possibly post images if I need to.

Thanks for your help.

My signature is NOT a moderator plaything! Stop changing it!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Dec 2010 12:40
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Dec 2010 12:52
Not funny. lol

My signature is NOT a moderator plaything! Stop changing it!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Dec 2010 15:37
I've solved this issue.

I just removed the mask completely. Not what I had in mind, but it'll have to do.

Turns out that what I had originally did work, just not how I expected. After a bit of careful thinking, I fiddled with some things and got it working. Then fiddled with some non related stuff and broke it again. So removed the mask and now it's functioning again.

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-21 20:35:15
Your offset time is: 2026-07-21 20:35:15