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 / Can I actually alpha-map an object?

Author
Message
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Jul 2005 03:40
Problem; Alpha Mapping commands exist in DBP, but can I use an *actual* alpha map, instead of just specifying the transparency level? (a.k.a using an image to specify the transparent areas)

I am unable to find a command that applies images as alpha maps, so its possible it has a strange/cryptic name or I'm just not looking hard-enough.

Thanks for any help.


[url=www.lightningstudios.co.uk][/url]
Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 1st Jul 2005 04:20
The only way I know of would be to put the objects texture into a memblock then overwrite it's alpha channel with the alpha map then retexture the object.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Jul 2005 04:27
Hmmm.... not really an ideal solution, since I really hate memblocks, and I have no-idea what I'm doing when it comes to alpha channel stuff.

Any other ideas?

[url=www.lightningstudios.co.uk][/url]
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 1st Jul 2005 05:27
Just open the objects texture in an image editing program and add an alpha channel.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Jul 2005 05:30
No, since I want to be able to actively swap between different alpha maps

[url=www.lightningstudios.co.uk][/url]
Louiz ofRohr
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 1st Jul 2005 05:33 Edited at: 1st Jul 2005 05:40
As Lost in Thought said:
You can gloom the most transparent areas as you want it..

When you ghost an object in DBPro, white areas are not affected
by ghost...

It's the most easy solution, but denatures the surface's aspect..


If want to animate the alphaMap, animate the texture...

The worst foe lies within the self...
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 1st Jul 2005 05:36
OK. If you supply the media for what you want I will see if I can come up with a function to do it this weekend. If no one beats me to it.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Jul 2005 05:52 Edited at: 1st Jul 2005 05:52
Okedoke. I'll have to supply it in two different posts.

First, the original image.

Note; If you do make a function for this, can be a general function (that will work on all objects) since I need alpha mapping for pratcially every object in my game....



[url=www.lightningstudios.co.uk][/url]

Attachments

Login to view attachments
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Jul 2005 05:53 Edited at: 1st Jul 2005 05:53
Now the alpha map.
Note the original image differs slightly from rgb000, that's why the alpha map is needed.

The alpha map also varies in monochrome tone, not just rgb000



[url=www.lightningstudios.co.uk][/url]

Attachments

Login to view attachments
Keaz
21
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 1st Jul 2005 06:04
Looks like a decent lightning effect.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Jul 2005 06:07 Edited at: 1st Jul 2005 06:08
Well;

If your interested, here is the on I have managed to find for 'close up' lightning bolts (as opposed for to other one I use for long-distances) This PNG uses transparency, so I'm not sure how it'll show up on the forum...


(Found on a royalty-free site. Free to steal if you want)

[url=www.lightningstudios.co.uk][/url]

Attachments

Login to view attachments
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 1st Jul 2005 06:09
I'm sure I can come up with something But it will use memblocks editing the object's texture's alpha channel. It will however keep the original texture as a backup so you can swap between alpha channels. It will work like either of these 2 you want:

1) Load both images and run the function to texture the object with the new alpha mapped image. Run the function again supplying a different alpha map image to realpha map it using the same or different base image.

or

2) I can just write a function to combine the 2 images and save as 1 to save on loading time.

Or I can do both 1 and 2 so you can test it.

Any other ideas let me know.

Math89
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 1st Jul 2005 06:29


I did an alpha map fonction last day : image is the number of the image you want to alphamap, map$ is the filename of your alphamap, values behind min are black and values bigger than max are white, multi is the multiplier. You must be in 32 bits mode and you must load your images with a ",1" : load image "image.bmp",number,1
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 3rd Jul 2005 18:08
Cool. You can modify that code just a bit for a little speed boost (yet memory loss) by preloading the alphamap image.



You can even add a save image line inside the function to save your alphamapped image for loading later so save even more time.

Login to post a reply

Server time is: 2025-06-02 14:10:15
Your offset time is: 2025-06-02 14:10:15