Jump to content
  • Advertisement

Archived

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

Unreal

HUGE Performance Drop CubeMaps + PS 2.0

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

Hello people! I a problem with Dynamic Cube Mapping... A have a room. In the center I have a sphere. Everything is based on Pixel Shaders (ARB_fragment_program) Without dynamic cube mapping I get 160 fps on a radeon 9700NP. I use Phong lighting model. When I am using dynamic cube mapping the frames goes to 25!!! This is a Huge Performance drop! I think this is beacause I render the scene 7 times(6 for the cube map and 1 for the world) with pixel Shaders. what can I do to oprimize the performance? Any ideas? I have also an other problem. Is about the quality of the cubemap textures are created in runtime but i will make an other post for it with screenshots. thank you guys! bye!

Share this post


Link to post
Share on other sites
Advertisement
Well, you might not have to re-generate all the cubemap faces each frame. Depending on the angle at which you are looking at the reflective object from, some faces of the cubemap won''t be used anyway. That''ll pretty much always get rid of at least one rendering of the scene. . .

Share this post


Link to post
Share on other sites
That performance sounds about right:

1 scene render (no cubemaps) = 160 frames per second.
7 scene renders (1 + 6 cubemaps) = 25 * 7 = 175 frames per second.

So in fact, you''re actually getting *increased* performance when you switch to cubemaps!

Ok, I suppose I''m not being very helpful am I? The only thing I can think of is to not use dynamic cube maps - generate them offline in 3DS MAX / Photoshop / whatever, and you can switch cube maps depending on the environment the camera is currently in. Or, you could somehow reduce the amount of detail the scene is rendered with when you render each cube map. Hope that helps a little.

Share this post


Link to post
Share on other sites
Well, as Hinch said,

7 scene renders (1 + 6 cubemaps) = 25 * 7 = 175 frames per second.

Really, the 6 cubemaps are _probably_ a lower resolution than the scene is, and if ''Unreal'' is using pixel shaders, then the lower resolution should decrease the amount of time taken to render.

But yeah, like Ostsol said, you may not have to re-generate all the cubemap faces each frame. If the scenery is static also, I believe you could render to the cubemap 1 time and then use that. Or only update the cubemap every 6 frames or so. But if anything, you don''t need to generate them offline in 3DS MAX or another program, when you could just render to the cubemaps once, if needed.

Man, Ostsol mentioned having some of the cubemap faces not used anyway, depending on the angle viewed at, I''ve never thought of that technique before. Thanks!

Anyway, cubemaps are a pretty effective way to slow things down! Also, not that it matters, but I''ve found an example before to create realtime spheremaps. And using a spheremap, you only have to render the scene 1 extra time. But there are also extra calculations needed to warp the spheremap.

Aeroum

Share this post


Link to post
Share on other sites
well.. dynamic sphere mapping is a good idea. but how do you implement it?I can not find any tutorial. You render the scene to a texture and then? how you apply it to the object? I saw somewere that you need to orbit the texture. I dont know what is this.
I can not use static cube maps besacause i have dynamic lights on the scene that creates different specular light while moving in the room.
How I aply the texture image to the object to do dynamic sphere mapping?

Share this post


Link to post
Share on other sites
Getting dynamic sphere mapping looking right is very difficult. In order for it to look right, you'd need to render the scene with a "fish-eye" camera lens. AFAIK that's not possible in DX or OpenGL or any other real-time API, as they only support frustum-based views (to get a nice fish-eye effect, you'd have to ray-trace the scene).

But I think one of the DX sample apps demonstrates a technique you could use to make a "fake" spherical environment map - the BumpLens one I think, where it uses bump mapping to simulate a lens effect. You could take that 'lens' and use it as your spherical env map. That would mean you'd only have to render the scene once (using the BumpLens technique) to get the spherical env map, then again to do it with reflections. Oughta give you something interesting to look at anyway!

[edited by - hinch on September 23, 2003 9:16:30 AM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!