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 / Using 'set object transparency' draws only to camera 0

Author
Message
Broken_Code
14
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 18th Nov 2013 11:50
Hello!

I'm using bond1's Bloom shader, with camera 1 as my Bloom camera and camera 0 as my Screen camera.

When I use set object transparency that object appears only on camera 0 (unless I set the object mask to not appear on cam 0, in which case it doesn't appear at all!), if don't use set object transparency then that object appears on all cameras as expected.

Anyone know anything about this?

Thanks,
Bruce
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 18th Nov 2013 22:35
I know for a fact that transparency works just well with camera 1, thus it is likely it should work with any camera.
Does the entire object disappear for your secondary camera?
If so, have you checked its normals / turned backface culling off for it?


"Why do programmers get Halloween and Christmas mixed up?"
Sph!nx
16
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 19th Nov 2013 13:57
I'm not really that familiar with multiple cameras, but perhaps you should set the current camera when drawing to that specific camera?


Regards Sph!nx
www.mental-image.net
Broken_Code
14
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 19th Nov 2013 21:23 Edited at: 19th Nov 2013 21:24
Thanks for the responses, I found the root of the problem:
I was applying the set object transparency function after cloning the object from a pre-loaded object. When I applied set object transparency to the parent object before cloning a new object from it then it worked fine.

I thought that clone object copied and pasted the object into a new object ID? It seems that there are either some bugs with the function or it dosen't work as I thought.

Is this a bug or have I mis-understood what clone object does?

Thanks,
Bruce

Burning Feet Man - "... Why the hell did I chose game creation as a hobby!? "
SamKM
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 19th Nov 2013 22:18
I think clone object creates a totally new object, using the original object as a base. So only changes you made to it before cloning it would have any effect on the new object
Maybe you're thinking of instance object? That's like clone object, but all clones are dependent on their original object for things like vertex information, texture, etc. I'm still not sure if it has any effect on instanced objects if you adjust the original object after instancing them, though... I guess it would in theory, but probably safer to just put stuff before instance object/clone object
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Nov 2013 23:10
Nope. I'm sure Broken_Code is correct - clone object should be a quick way of creating a new object which you can then modify in the usual way.

Sounds like we need a short, emphasise short, compilable and runnable snippet which we can test.

I smell the blood of a bug ...



Powered by Free Banners
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 19th Nov 2013 23:39
Quote: "Nope. I'm sure Broken_Code is correct - clone object should be a quick way of creating a new object which you can then modify in the usual way."

Yes;

Quote: "I was applying the set object transparency function after cloning the object from a pre-loaded object."

It is slightly unclear whether he applied the function to the new clone object or the source one. If he activated transparency for the source object after creating the clones, the clones would obviously not share that setting. However if it doesn't work to set specifically for a cloned object then yes, that sounds like a bug.


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Nov 2013 00:36
Yes, hence my request:

Quote: "Sounds like we need a short, emphasise short, compilable and runnable snippet which we can test."


I emphasise short, compilable and runnable. It continually amazes me how people expect us to fill in all the essential missing gaps from a small extract of a much larger program. Quite often the simple task of producing a short snippet exhibiting the symptoms will highlight the problem in itself.

But let's wait and see.



Powered by Free Banners
Broken_Code
14
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 20th Nov 2013 08:19 Edited at: 20th Nov 2013 08:22
Quote: "It is slightly unclear whether he applied the function to the new clone object or the source one. If he activated transparency for the source object after creating the clones, the clones would obviously not share that setting. However if it doesn't work to set specifically for a cloned object then yes, that sounds like a bug."


I was applying set object transparency to the new object not the base object.

Quote: "It continually amazes me how people expect us to fill in all the essential missing gaps from a small extract of a much larger program."

I didn't, in fact what I expected was "No, that's just how that function works but it's not mentioned in the help", because that's the answer to most of These kinds of Problems!

Quote: " emphasise short, compilable and runnable."


I'll see if I can knock-up a demo later today.

"... Why the hell did I chose game creation as a hobby!?" - Burning Feet Man
Broken_Code
14
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 20th Nov 2013 10:04
Hm. I made an example of this (Texture in download):

but as you can see it works perfectly.

This is now even more confusing. I'll try and make an example when I get home this evening with bond1's shader and see if I can replicate it then.

"... Why the hell did I chose game creation as a hobby!?" - Burning Feet Man

Attachments

Login to view attachments
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Nov 2013 11:43
Quote: "I didn't, in fact what I expected was "No, that's just how that function works but it's not mentioned in the help", because that's the answer to most of These kinds of Problems!"


Fair comment.

Quote: "but as you can see it works perfectly."


Sounds like you're homing in on the crucial point now.

Quote: "I'll try and make an example when I get home this evening with bond1's shader and see if I can replicate it then."


Looking forward to that.



Powered by Free Banners

Login to post a reply

Server time is: 2025-05-16 01:22:19
Your offset time is: 2025-05-16 01:22:19