Jump to content
  • Advertisement
Sign in to follow this  
poigwym

DX11 Dx11 Renderstate

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

Hellow everyone.

I learn dx11 recently, and find the dx11 render state  is strange, why the render state is designed to an object? 

I think the  context->setRS(xxx)  is more flexible to use.  such as depth enable,  I just only to store depth enable = true, 

setMaterial(material) 
{
    if(material.context.depthenable == true);   context->setRS(depthenable, true);

   else context->setRS(depthenable, false);

}

 

Some Book, sb,  create some render state which is often used like blend, back face cull,  it start to look a little better, but good times 

don't last long, since the object encapsule several sub state, 

when I want to use a new state which is a little different from those created states (such as blend-add is very similar to blend-alpha), 

I have to create a new one.

 

 I don't know how to easy to handle the dx11 render state object.  Who can show me how you use these ridiculous things?

Edited by poigwym

Share this post


Link to post
Share on other sites
Advertisement
You could create your own state manager to make things easy and flexible. It's investing once but you can make it exactly as you want and need it. That way you can also make sure you don't do any redundant state setting.

As for the "ridiculous", I personally think it's pretty useful to be able to change states :)

Share this post


Link to post
Share on other sites

You could create your own state manager to make things easy and flexible. It's investing once but you can make it exactly as you want and need it. That way you can also make sure you don't do any redundant state setting.

As for the "ridiculous", I personally think it's pretty useful to be able to change states :)

 

How to make one?

Share this post


Link to post
Share on other sites

Moreover, think that you wont have *that* many crazy combinations of state. The APIs tend to be way, way more flexible than what you really need. Its not about providing everything the API allows you to do, but to restrict it to an useful subset of features.

 

With all render passes and materials known before hand (and you will know them), you can easily create all the state objects you'll need. After that you can proceed like Mathias suggested, switching them (whole) as necessary.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!