Jump to content
  • Advertisement

Archived

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

Tooko

DirectDraw Wrapped

This topic is 5221 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Heyall, I''m writing a 2D Engine using DirectDraw, and I need ideas. I''ve already implimented alpha blending, and I''m programming automatic texture generation at the moment... but I need some cool effects I can add in. I''m planning to add support for lights, self-shadowing (to make a 3D appearance) and stuff like that. So... whatcha think?
I would''ve called an ambulance, but I was downloading stuff.

Share this post


Link to post
Share on other sites
Advertisement
Well, as I''ve only added bitmap loading and alpha blending there isn''t much to see. Lighting is looking pretty good, it runs incredibly fast too.



I would''ve called an ambulance, but I was downloading stuff.

Share this post


Link to post
Share on other sites
I''m thinking of adding these two features.
1. Custom filtering. You know how you can write filters in photoshop and paint shop pro? It''s like a 5x5 array of ints. Anyway, I''m thinking of adding this into it. I''ve downloaded smoe code samples of how to impliment it, but I''m not sure if it''s a waste of time.
2. Texture callback functions. Kinda like a pixel shader, but you supply a pointer to your own function that gets the x,y location of what pixel is being drawn and some other stuff and it returns the colour of the pixel to be drawn. You could create some really cool effect with this but then again could be a waste of time.

What do you think?



I would''ve called an ambulance, but I was downloading stuff.

Share this post


Link to post
Share on other sites
That custom pixel function might be interesting, but may be quite slow in practice. And if you would use it then you''d have to write your own blit routines which would look smth like:


for i = 0 to height - 1
for j = 0 to width - 1
pixel = PixelCallback(bitmap[i * width + j])
next
next


this will require you to lock the surface each frame which, as i remember is quite slow.

Share this post


Link to post
Share on other sites
quote:
Original post by Ilici
That custom pixel function might be interesting, but may be quite slow in practice. And if you would use it then you''d have to write your own blit routines which would look smth like:


for i = 0 to height - 1
for j = 0 to width - 1
pixel = PixelCallback(bitmap[i * width + j])
next
next


this will require you to lock the surface each frame which, as i remember is quite slow.




I have been locking the frame each time, and it runs quite fast. I haven''t tested it on my current computer, but on my old PII 366MHz locking it every frame went from 40FPS to about 39FPS... but that''s from memory.

EIther way, this runs at a very decent framerate (not tested yet) and looks pretty good.

Using the 5x5 filter array would be slow, because the time it took to calculate every pixel would be 25 times slower.



I would''ve called an ambulance, but I was downloading stuff.

Share this post


Link to post
Share on other sites
You could do this filter thingy without locking the surface, straight in H/W but only if you code it using pixel shaders... hell, one of the reasons I hate them is ''cause me GeForce2MX400 has no sopport of them... pesky buggers...

But useful, I''ll give you that you could also implement custom coloration/tinting, sepia tone mode, b/w color filtering, stuff like that... try it, tell us if you come up w/ sth

Keep up the good work

-----------<<>>-----------
Flareman (a.k.a Ga1adaN)
Primus ante Adain
flareman@freemail.gr
-----------<<>>------------

Share this post


Link to post
Share on other sites
Nah, I''m using DirectDraw to do the drawing so, no pixel shaders. I''ve done shading the way D3D has, ie each point of a polygon can have a different colour and it blends between them, the lighting engine has been temp. suspended because it was too slow but I''m working on the filtering.



I would''ve called an ambulance, but I was downloading stuff.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!