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 / Transparency and Shaders

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Mar 2012 06:11
Hi all,

Is it possibly to apply a PNG texture to an object (say, the leaves of a tree) while using a Normal Map effect (using shaders) and have it use the PNGs alpha channel as the transparency key?

When using the leaves shader it does it automatically, but when using a normal map shader it doesn't...


MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 25th Mar 2012 09:21 Edited at: 25th Mar 2012 09:22
answer should be yes... however I think using .tga would bring better results

or even better... .dds

but it all comes down to your photo manipulation applications and their export options

hopefully you have Gimp already

hope this helped...

and hopefully someone who is wider awake than me {07:20am UK time] will come along and also explain how to enable transparency should you require assistance for it too

[SET OBJECT TRANSPARENCY...]




EDIT

OH and hopefully someone can also answer the shader related question... I forgot about it sorry...

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Mar 2012 09:24
Hi MrValentine! Thanks for getting back to me. I've tried the SET OBJECT TRANSPARENCY but that just puts black boxes around my objects since SET IMAGE COLORKEY doesn't have a value for pure transparency in an alpha channel (such is in PNGs, DDSs or TGAs)

But I might have a play around with alternative file types and see what happens.

Any other advice would be helpful!


MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 25th Mar 2012 09:26 Edited at: 25th Mar 2012 09:36
oh set the transparent areas as magenta colourkey... try that...

EDIT

Though large... .bmp does transparency well enough...

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Mar 2012 10:10
Tried that didn't work. Perhaps a different shader than the NormalMap shader would handle the transparency...


CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th Mar 2012 10:14
Ahhhhhhhhh never mind... Found the solution.

There's a shader called NormalMap_a.fx which handles transparency in textures.

Fixerated!


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Mar 2012 14:43
Was just about to say that it has to be handled within the shader. Glad you figured it out

TheComet

Login to post a reply

Server time is: 2026-07-09 17:42:57
Your offset time is: 2026-07-09 17:42:57