Skip to main content
GameDev.net gamedev.net
🔒 Locked

Land1 Example, Rendering to Texture

Started by Gary Oct 9, 2000 at 6:08 PM 6 replies 300+ views
Original Post
Gary
Gary
The Land1 example has some code that renders to a texture. However, although the code works fine on my g400, on my ATI Rage it displays random garbage on the texture. After a short while it will stop rendering anything all together until I reboot the machine. I also tried it on my Voodoo II and I ended up with part of the correct image on the texture plus a bunch of garbage. For testing reasons I set the texture size to 64x64 but it still is occuring. Why would this be happening and is there anyway to do this that would work on almost 3d video card? Gary Edited by - Gary on 10/9/00 9:46:57 PM
Whirlwind
Whirlwind
Hmmmm... looks like it is rendering the texture to video memory which doesn''t get cleaned up properly after the rendering is done.
Gary
Gary
I don''t think it''s that because after some further looking on my Voodoo II, it looks like my vodoo II is rendering the object, completely onto the primary surface and putting the random grabage in the texture (which I''m drawing as an overlay). On my G400 it works fine, and on my ATI I only see the random garbage overlay not even the object rendered at all. I think it has something to do with the use of multiple PR_NewFrame and PR_RenderFrame''s per actual game frame. But I''m still not sure... and I have no clue how to get around it. Besides I don''t think the render surface can exist outside of video memory.

Gary
Gary
Gary
I've changed my mind. I don't think it's the PR_RenderFrame and PR_NewFrame because if I leave the direct3d device pointed at the backbuffer, it renders both the object and the scene ok. I could tell this because I grabbed the backbuffer between the two PR_RenderFrame and PR_NewFrame pairs.

I've been successful in grabbing the rendered texture out of the backbuffer and manualy putting it into the texture. However, this seems like a waste of system resources to me if I can get it to render it into the texture originally I can skip a massive amount of data copying.

If anyone has managed to get a card like the ATI rage or Voodoo II to render directly onto the texture or if anyone has any clue as to what may be happening that it doesn't work I'd be greatful for the information.


Gary


Edited by - Gary on October 11, 2000 3:43:02 AM
ChrisE
ChrisE
I didn''t think Voodoo2 even supported rendering to a texture, since textures are stored on the TMU memory (seperate from the rest of the video memory).

Author of Power Render (http:/www.powerrender.com)
Gary
Gary
That would explain the problem. Thanks...



Gary
Gary
Gary
I have another question. How do you deturmine whether a video card is capible of rendering to a texture. I noticed that the land 1 example checks the PR_D3D_texFormatBumpU8V8. So I guess it''s saying if the card is new enough to have bumpmapping that it should be able to render to a texture.

Is this safe to assume or is there a better way?


Gary
ChrisE
ChrisE
There is probably a DirectX caps bit for that. My example was built specifically for Matrox G400 which was the only card that was capable of EMBM at the time.

It''s probably safe to assume if a card has EMBM that it can render to a texture. However there are ones that don''t do EMBM and can render to a texture so it''s not the flag you want to check.

There''s nothing in PR that holds this flag, so you''ll have to use DirectX calls to find out.

Chris
Author of Power Render (http:/www.powerrender.com)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.