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 / Looking for an alpha shader?

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Oct 2011 13:50
Hey guys,


I searched the forum, I searched google... I can't find a solution for what I'm trying to achieve. Let's say I have a model of Saturn (the planet), more specifically, the ring of saturn. I have:

-ring texture
-transparency map

I'd like to be able to texture the ring with the texture (no problem), and then use the transparency map to make areas on the ring more transparent than others. DBP only supports a fully transparent mode. Is there a shader somewhere I could use?


Thanks,

TheComet

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Oct 2011 14:15
Maybe you could try the Image Kit to make the right parts of it transparent?

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 24th Oct 2011 15:43
I don't see the difference from the standard DBP alpha handling, please explain a bit more. (for more efficiency?)

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Oct 2011 16:08
OK, I'll try and explain it with sprites. You know how you can make sprite images with RGBA? With the alpha value, it's possible to make specific areas of the sprite anywhere between not transparent (a=255) and completely transparent (a=0).

This however isn't possible with textures for 3D objects (at least to my knowledge). What if I wanted to make a window on my texture, and have only the window be slightly transparent, but still a little bit visible, yet the rest of the image should be not transparent at all?

TheComet

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Oct 2011 18:38 Edited at: 24th Oct 2011 18:39
Open the texture (rgb) image in Photoshop, go to the Channels tab and create a new alpha channel. Now open the alpha texture and copy it in to that channel. Save as targa (.tga) and it should work if you use only that combined image as texture for your object and set its transparency mode to be on.

Edit: the above can probably be achieved through other image editing programs as well.


"Why do programmers get Halloween and Christmas mixed up?"
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Oct 2011 19:40
Oh wow, would you look at that... It works o.O Does this work with PNG files as well? Attached is an example demonstrating what Rudolpho said.

Thanks

TheComet

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 24th Oct 2011 21:17
Yeah it works with .png and .dds files too

[b]
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Oct 2011 21:21
I think it works with any file type that supports an alpha channel (ie. tif or a 32-bit bitmap). PNG probably works, but it's possible that it rather relies on the transparency in the image over an explicit alpha channel. But just give it a try and you'll know


"Why do programmers get Halloween and Christmas mixed up?"
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Oct 2011 21:36
Thanks for the help everyone

TheComet

Login to post a reply

Server time is: 2026-07-10 06:07:33
Your offset time is: 2026-07-10 06:07:33