Jump to content

  • Log In with Google      Sign In   
  • Create Account

Shadows in Direct Draw


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Freeride Designs   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 January 2000 - 07:06 AM

Does anyone know a fast way to make an area of a direct draw (DX7) surface darker to make shadows, I''m sure there must be a quicker way than alpha blending. Thanks for any help

Sponsor:

#2 Staffan   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 January 2000 - 09:21 AM

i think not, but if there is, make sure you let me know
also, try implenting alpha blending using Direct3D or OpenGL to make use of the 3D accelerator (if there is one, otherwise HEL is used), this is FAST.

#3 Starfall   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 January 2000 - 01:42 PM

You can shift the pixel to the right one bit to darken it, and bitwise AND it with a pre-prepared value (it needs to contain the MSB for the red green and blue components). If you are in 16-bit mode you can make a 128k lookup table, which is an alternative way of doing it. Another shortcut in 16-bit mode with the original method is operating on 2 pixels at a time (just remember to make your AND value work with this by shifting it left 16 bits and bitwise ORing it with the original value). I''ve assumed that you don''t need to have different levels of shadow, but if you do, then alpha blending isn''t going to be much slower than a specific function optimised for darkening.

Regards

Starfall




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS