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 some code not working

Author
Message
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 2nd Oct 2010 16:45 Edited at: 4th Oct 2010 03:57
hi

i had this idea about how to render lots of 3D grass using only 2 polies per cluster, and i think this is close to the way FarCry 2 does it. (if you run the code you'll see how the billboard clusters spin; i noticed that happening in FarCry 2 once and thought about why it would do that. this is what i came up with)

i'm rendering some cones with a secondary camera. i set the camera to an image and texture some planes with it so i get images of the cones. i set the secondary camera's backdrop to black, the image colorkey to black, and set the plane objects' transparencies on. but the planes are not transparent.

the second problem is with sync mask. if i set the sync mask to 1, that should enable camera 0 and disable anything else, right? it's not working in this code, which is why i commented out the RenderGrass subroutine.



and how do you get syntax highlighting in a code box??


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 2nd Oct 2010 17:07 Edited at: 2nd Oct 2010 17:08
Quote: "the second problem is with sync mask. if i set the sync mask to 1, that should enable camera 0 and disable anything else, right?"

Yes.

I don't see any problems with your SYNC MASK. However, I did notice this:



That looks like it would loop over and over again forever...

Did you mean to write this?



As for the transparency, I'm not sure what the problem is there.


Quote: "Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill...."

lol


Guns, cinematics, stealth, items and more!
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 2nd Oct 2010 17:14
oh i didn't even catch that infinite loop. that fixes the billboards being rendered in the PLANECAM. can't deal with this opaqueness though


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 2nd Oct 2010 17:48 Edited at: 2nd Oct 2010 17:50
I made a shader to deal with your transparency problem, just in case a fix in DBPro is not found. To use it, just load it using the LOAD EFFECT command:

ex.


and apply it to each of your billboards like this:


If you like, you can change the maximum color brightness that will trigger transparency like this:


The values go from 0.0 (pitch black) to 1.0 (bright white). All colors less than or equal to this brightness will be transparent. I have it defaulted at 0.10, but you can change it to 0.0 if you want only absolute pitch black to be transparent.

The shader is attached


Guns, cinematics, stealth, items and more!
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 4th Oct 2010 01:33 Edited at: 4th Oct 2010 03:57
sadly not even the shader is setting the transparency. i'm at a loss now.



if anyone can tell me why these billboards won't transparent, you can have this carrot

also if anyone can tell me how to get syntax highlighting in my code snippets you get this kiwi


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 4th Oct 2010 02:35 Edited at: 4th Oct 2010 02:38
Try using SET OBJECT TRANSPARENCY on the object along with your SET OBJECT EFFECT command.

Code tags: http://forum.thegamecreators.com/?m=forum_view&t=161402&b=2

Typing this:
[*code lang=dbp*]
print "Hello World!"
[*/code*]

without the *'s will give you this:




Guns, cinematics, stealth, items and more!
Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 4th Oct 2010 03:56 Edited at: 4th Oct 2010 03:57
it works now thanks for all the help. still wonder why just using set object transparency didn't work, but it must be a camera image thing.

oh btw


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Oct 2010 19:29
Not sure, maybe it was the image that was being grabbed not being treated as transparent? I haven't had a lot of luck with this myself, but apparently set bitmap format can fix that. The transparency command is newer than the set object command and I think it is better in the main. Still you have it fixed anyhow

http://s6.bitefight.org/c.php?uid=103081
Help people
15
Years of Service
User Offline
Joined: 4th Oct 2010
Location: Tombsville
Posted: 4th Oct 2010 23:04
Hi mates, I am new here. My first post here and I like to be the part of this community.

Thanks
Steve

Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 5th Oct 2010 04:00
odd chosing a random thread for an introductory post, but welcome


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 5th Oct 2010 06:50
Not to create a problem after its already been solved, but you could use memblock images to create a transparent image - not sure how fast that would be tho.

it doesn't seem like set image colorkey has ever worked for me :\

Image All
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 5th Oct 2010 16:45
it works if i load a .bmp and use that as the texture.


Remember those old guys? They made epic renders, I think one of them was called DaVinci, and all they used was MS Paint. Sometimes it's just skill....

Login to post a reply

Server time is: 2026-07-22 03:51:16
Your offset time is: 2026-07-22 03:51:16