• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Drki

Transparent shadows with DirectDraw (HELP)

8 posts in this topic

A Wild guess is that they are not blitting the color at all, but simply using it as a mask to tell what pixels to cast shadow on. A really rough shadow (which is what they have in starcraft) can be made by simply down-shifting the color value of pixels within the shadow mask.

/Niels

0

Share this post


Link to post
Share on other sites
Thanks but there is a small problem with down-shifting the color value of pixels within the shadow mask.
I dont know how to do this. Can you give me little more info (source would be nice)?
0

Share this post


Link to post
Share on other sites
Hello...

You should read the "MMX enhanced alpha blending" article. It shows how to access the Vram of the surface and reading data from it.

Bye

0

Share this post


Link to post
Share on other sites
Starcraft is 8 bit mode, isn't it? They must have some special lookup table that determines the correct colour to shift by.. it looks up the source colour and then knows which colour to draw the shadow in..

.. or is Starcraft 16 bit?

0

Share this post


Link to post
Share on other sites
What's the resolution you're working with? If it's high enough, you may be able to get by SIMULATING the shadow by using alternating BLACK and TRANSPARENT pixels for the shadow, thus giving a decent appearance of shadow. (Since every other pixel in the shadow area will be black, it will let some of the background through, and black out the other parts. Logically making the background about 50% dimmer than it was.)

One of the benefits of this (if it will work for your articular application) is that the shadow data can be a part of the sprite itself, so you can save time by only blitting one surface per sprite.

Of course, that's just one way to work the issue.

-Marc

------------------
-Marc
Clan Destiny
www.mp3.com/clandestiny

0

Share this post


Link to post
Share on other sites
True alpha blending is definately the way to go, but if performance is a problem (I.e. you're targeting low-end HW), there are tricks you can play, such as 50/50 blends or dithering.

Reg. how to do it, I too recommend reading that article. The "downshifting" I was talking about is this:

Asuming you have a "mask" that tells which pixels should be covered by the shadow (E.g. a black/blue picture of the shadow). You check each pixel in the mask, if it is "blue", you get the color of the corresponding destination pixel and divide each color channel (Red, green and blue) by 2, by right shifting the value, and store it again. If the mask pixel is "black" you do nothing. (Preferably the mask is a 1-bit picture to save memory, but thats a different story).

If you are running 8-bit mode, you need a mapping table that maps each of the 256 colors to its best 50% representation.

/Niels

0

Share this post


Link to post
Share on other sites
Oh, just read the original question again: SRCAND doesn't work (It didn't in DX5, and I don't believe they've changed that, or?). In fact, nothing in DirectDraw works, besides blit, colorkeying and surface pointers.

(This IS quite sufficient, just pretty annoying that they can't tell the truth in the documentation, but rather see us waste precious time finding out for ourselves ... Doh! )

/Niels

0

Share this post


Link to post
Share on other sites
Well, thing is like this.
In Starcraft to blit a unit Blizzard have two surfaces. One is a unit and the other one is shadow of that unit (which is represent in blue color - dont know why?).
I have done the same thing in my game.
I blt the blue shadow with SRCAND ( to get transparent shadow ) but thing aint working.
For example when unit is on white part of screen the shadow is normaly blue.
I have try other shadow color but it just isnt working.

Any idea what should I do or just know what I am doing wrong plese replay or mail me.

0

Share this post


Link to post
Share on other sites
I understand that I have to downshift pixes that are blue in the mask I just dont know how to access a pixel in surface.

Could it be done with palletes cos I am using 8 bpp, but then I dont know how to use pallete on a single surface.
I have succeeded attaching pallete only on primary surface. Thanks

0

Share this post


Link to post
Share on other sites