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 sync mask...

Author
Message
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 1st Jan 2010 05:30
well, im working on a level editor, and I have four different camera views with different effects that need to be updated seperately. I tryed sync camera, which highlighted but had no docs and didn't work. i also tryed sync mask, but I don't even faintly understand hex...
is there anyone who can tell me how to get it so that each sync renders a seperate camera, e.g.



dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 1st Jan 2010 06:38 Edited at: 2nd Jan 2010 06:26
Binary(preferable if you are using literals):
%001 = Mask required to render camera 0 only
%010 = Mask required to render camera 1 only
%100 = Mask required to render camera 2 only
%101 = Mask required to render camera 0 and camera 2

Hexadecimal:
0x01 = Mask required to render camera 0 only
0x02 = Mask required to render camera 1 only
0x04 = Mask required to render camera 2 only
0x08 = Mask required to render camera 3 only
0x09 = Mask required to render camera 0 and camera 3

Power: [edit] Fixed, didn't read what I wrote, clearly
2 ^ 0 = Mask required to render camera 0 only
2 ^ 1 = Mask required to render camera 1 only
2 ^ 2 = Mask required to render camera 2 only
2 ^ 3 = Mask required to render camera 3 only
2 ^ 0 || 2 ^ 3 = Mask required to render camera 0 and 3

Bitshift(preferable if you're evaluating the mask at runtime):
1 << 0 = Mask required to render camera 0
1 << 5 = Mask required to render camera 5
1 << 8 || 1 << 5 = Mask required to render camera 8 and camera 5

Decimal:
1 = Mask required to render camera 0 only
2 = Mask required to render camera 1 only
4 = Mask required to render camera 2 only
8 = Mask required to render camera 3 only
16 = Mask required to render camera 4 only
17 = Mask required to render camera 1 and camera 4

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2010 13:37
You don't need sync mask with with sync camera (and I guess it won't work if you get the mask wrong).

If you just want to sync your 5 cameras separately in sequence use simply:



Camera 1 must exist or you'll probably get strange results. Cameras must be numbered consecutively - I'm sure this used to be in the Help file but I can't find it now.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jan 2010 15:03
@dark coder,
Your 'power' list is incorrect:
Power:
2 ^ 0 = 0
2 ^ 1 = 1
2 ^ 2 = 2
2 ^ 3 = 3
2 ^ 0 || 2 ^ 3 = 0 and 3

@thenerd,
SYNC CAMERA is a shader plug-in command, so the help is available from the start menu.

Here's what I use on the odd occasion I'm using multiple cameras:


You sync every camera except 0 first, then sync camera 0 last.

mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 1st Jan 2010 15:07 Edited at: 1st Jan 2010 15:08
<deleted>

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 1st Jan 2010 15:51
@GG,

I'll try adding camera 1...

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2010 23:36
Don't you just love it when people write sloppy things like:

Quote: "2 ^ 3 = 3"


???!!!

No wonder newbies often get confused with hex, etc.

Why not use plain language such as:

"Using powers of two, 2 ^ 3 corresponds to camera 3"
"Using decimal notation, 8 corresponds to camera 3"
etc

or shorter versions of the same things?

I know the intention was clear in Dark Coder's original post but a casual glance would be utterly baffling.

2 ^ 3 is definitely NOT equal to 3 (I know you know this but that's not my point).
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Jan 2010 01:07
True, and I apologise for simply copy/pasting

Oh, and a happy new year to you

dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 2nd Jan 2010 06:26
Happy now?

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Jan 2010 15:20
Quote: "Happy now?"


Yes.

And Happy New Year to you both too.

[I wish this flu would hurry up and go away though - it's put me off food, alcohol and coffee. ]
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 2nd Jan 2010 22:07
1^3 is also definitely not 3 XD


thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 3rd Jan 2010 02:45
yeah, thanks, sync camera works now after adding camera 1.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th Feb 2010 13:13
This post is awesome in helping understand just how the sync mask command can be used.

Many thanks for this wonderful information! lol

My signature is NOT a moderator plaything! Stop changing it!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Feb 2010 17:04
@IanM
When talking about power:
2^0=1
2^1=2
2^2=4
2^3=8
2^4=16.......

The fastest code is the code never written.
dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 26th Feb 2010 19:09 Edited at: 26th Feb 2010 19:09
He's referring to camera numbers there, previously I didn't use the highly verbose form of writing camera before everything.

Login to post a reply

Server time is: 2026-07-27 10:18:33
Your offset time is: 2026-07-27 10:18:33