cpreh / spacegameengine

An easy to use game engine written in C++
Boost Software License 1.0
7 stars 2 forks source link

Implement a render context without state sets #58

Closed pmiddend closed 11 years ago

pmiddend commented 12 years ago

The idea here is to get rid of: renderer.state(list_of_states);, simply because implementing backends for that is very tedious and not flexible enough.

Instead, we should have virtual functions for states. For example, instead of:

context.state(
    (fog_mode::linear)
    (fog_start = foo)
    (fog_end = bar)
    (...)
);

we should have

context.fog_properties(
    fog_properties(
        fog_mode::linear,
        fog_start::foo,
        fog_end::bar
    )
);

Using this, we can more easily implement:

Disadvantages of this approach are:

pmiddend commented 12 years ago

List of all core states:

List of all ffp states:

List of core "pseudostates" (states not in renderer::state, but already in the context in the described fashion):

List of ffp "pseudostates":

(alpha_func moved to ffp enums by Freundlich)

pmiddend commented 12 years ago

The whole issue might be something we should test in a smaller environment, first. I'm going to implement two scenic::render_contexts, one using the ffp, one using Cg. This could serve as a hint as to how the interface is going to look like.

cpreh commented 12 years ago

In D3D11, the following state sets are available (only the states that are currently implemented in sge are listed):