To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Games and Graphics Programming

Reply Post New Thread
 
Thread Tools Display Modes
Old Dec 2nd, 2004, 02:26 PM   #1
Halsafar
PowerPoster
 
Halsafar's Avatar
 
Join Date: Jun 04
Location: Saskatoon, SK
Posts: 2,339
Halsafar is on a distinguished road (20+)
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????
__________________
"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

Last edited by Halsafar; Dec 2nd, 2004 at 02:33 PM.
Halsafar is offline   Reply With Quote
Old Dec 2nd, 2004, 02:36 PM   #2
Electroman
Ex-Super Mod'rater
 
Electroman's Avatar
 
Join Date: Sep 00
Location: Newcastle, England
Posts: 4,354
Electroman will become famous soon enough (50+)
Re: Changing CULL Mode -- Cull Mode Types

Quote:
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.
Electroman is offline   Reply With Quote
Old Dec 2nd, 2004, 02:38 PM   #3
Halsafar
PowerPoster
 
Halsafar's Avatar
 
Join Date: Jun 04
Location: Saskatoon, SK
Posts: 2,339
Halsafar is on a distinguished road (20+)
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
Halsafar is offline   Reply With Quote
Old Dec 2nd, 2004, 02:49 PM   #4
NoteMe
Retired G&G Mod
 
NoteMe's Avatar
 
Join Date: Oct 02
Location: @ Opera Software
Posts: 10,190
NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)
Re: Changing CULL Mode -- Cull Mode Types

Quote:
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?



Quote:
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.
__________________
NoteMe is offline   Reply With Quote
Old Dec 2nd, 2004, 02:52 PM   #5
Halsafar
PowerPoster
 
Halsafar's Avatar
 
Join Date: Jun 04
Location: Saskatoon, SK
Posts: 2,339
Halsafar is on a distinguished road (20+)
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
Halsafar is offline   Reply With Quote
Old Dec 2nd, 2004, 02:54 PM   #6
NoteMe
Retired G&G Mod
 
NoteMe's Avatar
 
Join Date: Oct 02
Location: @ Opera Software
Posts: 10,190
NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)NoteMe is a glorious beacon of light (400+)
Quote:
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.....
__________________
NoteMe is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Games and Graphics Programming


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:30 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.