Skip to main content
gamedev.net
🔒 Locked

State Blocks

Started by CpMan May 27, 2003 at 9:27 PM 1 replies 450+ views
Original Post
CpMan
CpMan
OK, well, I was attempting to use state blocks as a method for easy management of states in my particle engine. However, I have found that, at least on my card (GF4Ti), the act of Capture() for a state block is suicidal to my framerate. The call itself takes about a half a second (pretty bad). Now, I know that driver support is fairly flaky among various cards, but should a penalty that is THIS high be expected when it''s not fully supported? Does anyone know whether late Nvidia cards support state blocks?
Gamedev for learning. libGDN for putting it all together. An opensource, cross platform, cross API game development library.
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.
Drilian
Drilian
You''re only supposed to run capture once.

You set the render state (via SetRenderState, SetTextureStageState, and SetSamplerState) to how you want it in the state block, then Capture() it.

Then, every frame, you Apply() it to restore the state to what you captured earlier.

Don''t capture every frame. It kinda defeats the purpose
CpMan
CpMan
Hehe, ok, cool, found my answer about 5 mins after posting this. Thanks



Gamedev for learning.
libGDN for putting it all together.
An opensource, cross platform, cross API game development library.
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.

Topic Locked

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

Sign in to reply to this topic.