Results 1 to 6 of 6

Thread: Changing CULL Mode

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Changing CULL Mode

    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????
    Last edited by Halsafar; Dec 2nd, 2004 at 03:33 PM.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Re: Changing CULL Mode -- Cull Mode Types

    Posted by Halsafar
    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.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  3. #3

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339
    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?
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  4. #4
    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
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339
    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.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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