GPWiki.org
GPWiki.org
It is currently Sat May 25, 2013 8:39 am

All times are UTC




Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Sun Jan 23, 2005 8:48 pm 
Technomaniac
User avatar

Joined: Mon Aug 23, 2004 12:24 am
Posts: 3096
Location: Washington , USA
That Alpha One light looks great...not much help, but really wanted to say I like it! :spin

_________________
GMan
Black Ninja Games
Imagine ASCII art here!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 23, 2005 8:52 pm 
Gamer Geek

Joined: Mon Aug 16, 2004 3:51 am
Posts: 33
Yeah, I'd use it if it were slightly diffrent, like being able to see through the center instead of it being solid -.-

Invisible


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 23, 2005 9:19 pm 
Also known as "Lucky"

Joined: Sat Aug 07, 2004 9:22 pm
Posts: 5853
Location: Vancouver, Canada
What bit depth are you using? That ROP picture looks like it has some artifacts resulting from low bit depth. Bapping it up to 32bit would fix it :)

But anyway, I think your main problem is that you're trying to get more detail out of a mostly black image. Alpha-blending a white image over a dark image is always going to look bad. You need to do the reverse, basically. You need the normal "day" image to be the default, and the dark areas need to be blended with black.

What you could do is create a black surface (at say 20% translucency) with a circle-gradient at the center, coming to a point where you have 100% translucency. You then display this surface over top of everything... it would make the outlying areas appear shady, and the center appear as clear as daylight.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 23, 2005 10:41 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Fri Aug 20, 2004 1:58 pm
Posts: 538
Location: UK
Image


Take one alpha surface,
colour as required for ambient light level,
add lights in white,
use for either alpha of black surface over scene, or scene alpha over black.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 23, 2005 11:34 pm 
Also known as "Lucky"

Joined: Sat Aug 07, 2004 9:22 pm
Posts: 5853
Location: Vancouver, Canada
Yes, pictures make it much more clear than my confusing words :O

AT to the rescue!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 1:19 am 
Gamer Geek

Joined: Mon Aug 16, 2004 3:51 am
Posts: 33
Could you please provide more steps to it? It's a good start, but pretty vague.

P.S. I can't change the screen res from 640x480x16 to 640x480x32 because my graphics card only supports 16 colors, 256 colors, 16-bit, and 24-bit.

VBStrider


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 9:39 am 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Fri Aug 20, 2004 1:58 pm
Posts: 538
Location: UK
(With reference to the above images)
Steps :

1) Generate your scene with daylight graphics as normal (top left image).

2) Create a black surface (black)

3) Create a second empty surface, grey. Lighter grey = less ambient light. White is totally dark. Black is not dark.
- the images above show this in reverse, because I did it differently.

4) Draw black circles onto the grey surface to represent lights - the image above shows how the circles should and should not merge to create correct lighting.

5) Draw the black image, using the grey surface as an alpha channel, down onto the back buffer.



------------------------------------------------------------------------------

I guess the two difficult bits will be :
1) Attaching an alpha channel to the light surface (because i've not done that before)
2) Correctly merging the lights


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 2:56 pm 
Obfuscation Ogre
User avatar

Joined: Fri Nov 05, 2004 2:32 pm
Posts: 306
Location: Eastern Europe
VBStrider wrote:
I can't change the screen res from 640x480x16 to 640x480x32 because my graphics card only supports 16 colors, 256 colors, 16-bit, and 24-bit.

Since it's not recommended you begin using 24 bit (some graphics adapters support just 16 and 32 bits) you should check out how your pictures looks in 16 bit (if rendered in 24 or 32) - probably render them all in 16 bit just to be sure it's OK. I had the same problem and sometimes was disappointed at what the difference was between the rendered one and drawn onto the surface. :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 4:00 pm 
Babirusa
User avatar

Joined: Thu Aug 19, 2004 2:55 pm
Posts: 9241
Location: The Netherlands
You'll probably see more gradient-like changes. Less fluent.. :)

_________________
Serious game developer

http://www.persistentrealities.com
http://www.persistentrealities.com/vbfibre
http://www.ambiances.nl


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 6:38 pm 
Gamer Geek

Joined: Mon Aug 16, 2004 3:51 am
Posts: 33
Does anyone know of an Alpha Channeling tutorial for DirectX7? Doesn't have to be in VB, I'll take anything you've got, just as long as it's DirectX7 :|

VBStrider


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 6:45 pm 
Also known as "Lucky"

Joined: Sat Aug 07, 2004 9:22 pm
Posts: 5853
Location: Vancouver, Canada
I may be wrong, but I think all you need to do is load a texture that has an alpha channel in it. TGA files can do this. So, you basically use photoshop (or whatever image manipulation tool you use) to add the alpha channel.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 6:48 pm 
Gamer Geek

Joined: Mon Aug 16, 2004 3:51 am
Posts: 33
Ok, I'll try that. Thanks 8)

VBStrider


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 7:19 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Fri Aug 20, 2004 1:58 pm
Posts: 538
Location: UK
http://www.chez.com/scribe/en/directx/d3d_ddraw.htm

Busy at work so i've not looked at the code yet ...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 7:19 pm 
Gamer Geek

Joined: Mon Aug 16, 2004 3:51 am
Posts: 33
Didn't seem to work :/ Don't know if it was simply a problem of not saving the .tga correctly though.

VBStrider


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 7:58 pm 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3735
Location: South Africa
AT: how did you blend the surface containing the lighting to the main daytime picture?
Right now I have a similar problem, I need to put lighting into my game and I've tried vbDABL but it's not so lekker, any other suggestions?
BTW: why the hell doesn't dd7 have alpha blending, what were those sadists thinking????? >:(

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 8:44 pm 
Level 22 Norse Warrior-Librarian
User avatar

Joined: Fri Aug 20, 2004 1:58 pm
Posts: 538
Location: UK
Stretched DX3D surface.
Though the example was done in photoshop :)

Basically though - this works by creating a transparency map / alpha map / whatever you want to call it for a black surface, which is drawn over the scene.

Must be an entry in the sdk somewhere for this ... ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 3:28 am 
Mumbo Jumbo
User avatar

Joined: Wed Sep 22, 2004 6:44 am
Posts: 789
IGTHORN wrote:
BTW: why the hell doesn't dd7 have alpha blending, what were those sadists thinking????? >:(


Well, I dont think any common graphics cards support alpha blending for simple 2D BLT's. If you make your engine a hybrid, (D3D/DD), you can do alpha blending.

Ryan Clark wrote:
I may be wrong, but I think all you need to do is load a texture that has an alpha channel in it. TGA files can do this. So, you basically use photoshop (or whatever image manipulation tool you use) to add the alpha channel.


Er, I looked at TGA files in PSP, it can do them, but it has the option for 8,16,or 24 bit files. Would one have to be running their display at 24 bit or higher in order for a game to display those properly? Or would directx just convert the colors to other color modes on loading it, if you are at another color depth.

A tutorial on various forms of alpha channeling would be rather neat.. (someone who has more time than me, write it please? :lol )


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 5:37 am 
Also known as "Lucky"

Joined: Sat Aug 07, 2004 9:22 pm
Posts: 5853
Location: Vancouver, Canada
I believe D3D automatically handles the alpha transparency for you (even at 16bit), if you load a texture which has an alpha channel.

VBStrider: Perhaps you didn't create your TGA file correctly when you tried to include the alpha channel?

Then again, I could also be wrong... I'm certain this works for OpenGL, and assumed it would for D3D as well.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 8:16 am 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6719
Location: Oxford, Englandshire
PSP Doesn't handle 32bit TGAs, it thinks that they max out at 24bit. To do 32bits you need Photoshop or The Gimp.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 9:04 am 
Babirusa
User avatar

Joined: Thu Aug 19, 2004 2:55 pm
Posts: 9241
Location: The Netherlands
Codehead wrote:
PSP Doesn't handle 32bit TGAs, it thinks that they max out at 24bit. To do 32bits you need Photoshop or The Gimp.


Hm. I'm sure I've seen 32 bit somewhere in PSP.. strange :)

_________________
Serious game developer

http://www.persistentrealities.com
http://www.persistentrealities.com/vbfibre
http://www.ambiances.nl


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group