Jump to content
  • Advertisement

Archived

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

flareman

Grayscale rendering using Jim's Tile engine from P_RPG_W/DX8.0 (modified)

This topic is 5714 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

Well, I have submitted a relative question some time ago, but I thought I''d come clean w/ all of you and ask again clearly, since I''d much rather ask again in a different manner than bump away :D In any case, here''s the chant, berks (Planescape anybody?): I''m using a heavily modified edition of Jim Adams'' tile map engine from Programming Role Playing Games With DirectX 8.0 - for those not having read the book, Jim uses a direct blit operation on the texture itself in order to draw part of it as a tile, no polygons et al involved. The point is, I want to be able to render to grayscale (or tinted grayscale, for that instance ), so as to emulate the effect used on old SNES FF games (flashback, memories returning, etc.). Sadly, since the map is blitted directly, without the intervention of polygons, I can''t use any texture states to get my job done, any of course creating grayscale versions of the tilesets is out of the question for obvious, I believe, reasons. S1CA and others who had replied to my first post had mentioned (thanks again Simon and fellas, for what it''s worth ) I could somehow render the frame normally somewhere and then render THAT rendering on-screen in B&W (phew). So, here are the questions: How can I achieve the grayscale effect in the method described above? (detailed answers please, I''m not much of a guru, I''d probably bump again for details, so spare me the swelling on the forehead:D) Is there any other way to do it, and if so, which one? Jim, Simon... anyone?Hello? -----------<<>>----------- Ga1adaN, Primus ante Adein flareman@freemail.gr -----------<<>>------------

Share this post


Link to post
Share on other sites
Advertisement
I've been following this discussion and I am also very intrested in how to render a grayscale image.

I saw someone write about renderstates and someone else was suggesting a PixelShader. I did not get any of the methods to work.

So, if someone have or know where to find an actual example (code) on how to do this (how to turn the whole backbuffer or just textures to b/w), please reply. Two versions of the textures is not an option for me ether.

Thanks!



[edited by - lexor on November 18, 2002 5:43:12 PM]

Share this post


Link to post
Share on other sites
well, here's somebody thinking my way
I tried pixel shading myself, but, alas, it won't work, because it functions w/ polygons as well (besides, pixel shading in h/w isn't supported by my lowly GeForce2MX400... ah, well)

Render states don't seem to give an immediate solution (perhaps there is one that we just can't see - enlightening, anyone?)

The best thing to do, in my opinion, would be to lock the rendered backbuffer, then perform a grayscale-conversion operation on EACH pixel, along w/ any tinting we needed - just tell me how to do it and I'm off nuts! (although I have that hunch about it not being the optimal way to do it - well, I'm not even sure whether it CAN be done in the first place!)

But I'm getting carried off. Suggestions?

-----------<<>>-----------
Ga1adaN, Primus ante Adein
flareman@freemail.gr
-----------<<>>------------

[edited by - Flareman on November 18, 2002 6:40:37 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
all i can say is, you gotta go grayscale before you tint, otherwise the result will be kinda kinky

hope this helps
Buzzah

Share this post


Link to post
Share on other sites
Yeah, I thought so myself, but the intitial question remains: HOW can I achieve grayscale rendering when the frame is already in the buffer? Can I modify the already rendered pixels, and if so, how? Or should I use another technique?

Fellas, help me out here;it''s getting sort of lonely in here...

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

Share this post


Link to post
Share on other sites
Instead of blitting/drawing to the frame buffer, just draw to a texture. The code shouldn''t change fundamentally (use the surface of the texture instead of the surface for the frame buffer) that way, and with that you can basically do all kinds of funky effects by just rendering two triangles to the screen.

- JQ
Full Speed Games. Are back.

Share this post


Link to post
Share on other sites
Well, that''s an option;however, I fear there could arise difficulties:

First of all, resolutions such as 640x480, 800x600 etc. aren''t completely powers of two, as the textures should be (perfect squares, that is), so it''s a bit more complicated (not to mention inefficient) to create a 1024x1024 texture in order to fin a 640x480 frame in it. Of course, if there is a workaround, I''d love to hear it.

In any case, I''d appreciate seeing some code, here;like I said, I roughly can go beyond the basics, so I haven''t the foggiest about rendering to another render target, or switching back to the back buffer (the SDK notes aren''t much of a help, either)

One more thing: ''don''t pretty much know why, but I stigg got that feeling that there MUST be a more efficient way to do this... all o''ya guys, you sure I can''t justlay my hands on the buffer itself somehow?

Answers...answers... (well, at least I didn''t have to bump

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

Share this post


Link to post
Share on other sites
Flaaaareman! Every time I check the forums and see a new post in the grayscale-thred I get excited to see if someone made a good post about solving the problem. But every time its just you and your bumps. Ahhh!

Share this post


Link to post
Share on other sites
OK, in order to be more constructive:
I haven''t read Jim''s book, so I know only what you have said in this thread about the methods you are currently using.
I think to be able to help more you''d have to tell us how the sprites (I assume?) are currently stored, and how you actually blit to the frame buffer - is it done using a custom blitter? (you said it''s DirectX8 right?) If not, how exactly are you blitting?

- JQ
Full Speed Games. Are back.

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!