Results 1 to 6 of 6

Thread: Changing CULL Mode -- Cull Mode Types

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Changing CULL Mode -- Cull Mode Types

    Showing my ability to apply the knowledge I have learned while D3D'in I figured out how to fix my skysphere.

    The sphere generation code was well written by someone. It was for OpenGL tho. It was also created to create a dome which is to be see from the outside.
    Well I needed a Dome that can be seen from the inside. So after re-arranging the vertex allocation, or trying to create a dome with a negetive radius I saw each had some graphical problems....Neither worked for me.

    SO

    I decided to change the CULL mode to None, then render the skysphere, then change it back to CCW.

    Works like a charm.

    So my questions are:

    D3DCULL_CCW -- remove counter clock wise triangles?
    D3DCULL_CW -- remove clockwise triangles?
    D3DCULL_NONE - Remove nothing
    D3DCULL_FORCE_DWORD -- What the f___???

    Does changing the cull mode cause any lag? doing it each frame?
    Is there a better way?

    What changing CULL modes should I save the old mode, or not?
    Will it matter?
    Can it be different than any of the 4 modes above????

  2. #2

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Changing CULL Mode -- Cull Mode Types

    Quote Originally Posted by NoteMe
    I decided to change the CULL mode to None, then render the skysphere, then change it back to CCW.

    Works like a charm.

    So my questions are:

    D3DCULL_CCW -- remove counter clock wise triangles?
    D3DCULL_CW -- remove clockwise triangles?
    D3DCULL_NONE - Remove nothing
    D3DCULL_FORCE_DWORD -- What the f___???

    Does changing the cull mode cause any lag? doing it each frame?
    Is there a better way?


    I don't believe actually changing it has any lag but if you set it to none and something you render has lots of verts that would normally be Culled and not seen then it will slow it down cos those verts are getting processed, the display won't change cos they aren't seen anyway but they still to travel the distance where as normally the Culler would have stopped them. This is more so for large objects like say you have a high detail mesh of a person. Rendering in NONE will cause the thousand or so verts on the side facing away from the camera get processed but not drawn, or maybe drawn but then overwritten with the near side. This would cause a noticable effect but a simple cube or any mesh that you want all triangles visible for won't matter.

  3. #3

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Changing CULL Mode -- Cull Mode Types

    Alright, sounds good.

    I added to my original post.


    Should I save the cull mode before changing it using GetRenderState. Then change it.

    Or will the cull mode always be on of the above 4 types?

  4. #4

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Changing CULL Mode -- Cull Mode Types

    Originally posted by Halsafar

    D3DCULL_CCW -- remove counter clock wise triangles?
    D3DCULL_CW -- remove clockwise triangles?
    D3DCULL_NONE - Remove nothing
    D3DCULL_FORCE_DWORD -- What the f___???

    Can it be different than any of the 4 modes above????

    Why don't you look up things like this in the doc?



    Syntax:
    Code:
    typedef enum _D3DCULL {
        D3DCULL_NONE = 1,
        D3DCULL_CW = 2,
        D3DCULL_CCW = 3,
        D3DCULL_FORCE_DWORD = 0x7fffffff
    } D3DCULL;
    Constants:

    D3DCULL_NONE
    Do not cull back faces.

    D3DCULL_CW
    Cull back faces with clockwise vertices.

    D3DCULL_CCW
    Cull back faces with counterclockwise vertices.

    D3DCULL_FORCE_DWORD
    Forces this enumeration to compile to 32 bits in size. This value is not used.

  5. #5

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Changing CULL Mode -- Cull Mode Types

    I knew all that.

    I just seem to see alot of people will store the old render state, change the render state, render whatever, change it back to the old.

    I figured it may be for the same reasons you have to save a WindowLong before you can alter it or else errors will occur.

  6. #6

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Changing CULL Mode -- Cull Mode Types

    Originally posted by Halsafar

    Or will the cull mode always be on of the above 4 types?
    If I am not wrong, one of them will always be on. And the CCW is the default one.

    Correct me if I am wrong here...I might be wrong here since I have worked so much with OGl lately.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width