Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


DX10... 3dMax Drawing..ZBuffer?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 AquaMacker   Members   -  Reputation: 255

Like
0Likes
Like

Posted 26 January 2013 - 12:19 AM

제목 없음.png

 

Hi...

Please look PIC...

 

I use 3dMax, maxscript and DX10.

 

I guess Zbuffer problem...

 

But zbuffer setting value is default value( == ON ).

 

pDevice->IASetPrimitiveTopology( D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP );

cullmode = d3d10_cull_front;

 

Indexing is fullvertexmodel... like this...

 

for ( int i = 0; i < nFaceNum; i++ )
{    
   pstIndices[i].A = j++;
   pstIndices[i].B = j++;
   pstIndices[i].C = j++;
}
 

 

Is related to cullmode, zbuffer or Indexing method ? 

 

I have no idea. Really... @.@

 

How to solve the problem ?

 

 

 

Please understanding my bad english...


Edited by AquaMacker, 26 January 2013 - 12:38 AM.


Sponsor:

#2 AquaMacker   Members   -  Reputation: 255

Like
0Likes
Like

Posted 26 January 2013 - 01:13 AM

I found this problem...

 

I insert code pFont->DrawText()... -> This is PROBLEM !!!

 

 

Clear~~~~

ObjectDraw() -> Cull_Front
pFont-DrawText()

Present( 0, 0 );
 

 

Object draw with Cull_Front ... ONLY !!!

 

but font->draw() after object seems like to draw Cull_BACK !

 

I guess DrawText() function is Only Cull_BACK Draw...

 

Is DrawText() function Bug ?


Edited by AquaMacker, 26 January 2013 - 05:05 AM.


#3 Nik02   Crossbones+   -  Reputation: 2869

Like
1Likes
Like

Posted 26 January 2013 - 09:17 AM

DrawText sets some device state in order to do its job, and it's not resetting the state for you. You should explicitly set all the states upon drawing your objects.


Niko Suni


#4 AquaMacker   Members   -  Reputation: 255

Like
0Likes
Like

Posted 26 January 2013 - 04:26 PM

Thanks
I'll try.

 

hmm...
I decided to use DX10.1. Direct2D...

DrawText is hard to use...


Edited by AquaMacker, 26 January 2013 - 10:00 PM.


#5 Nik02   Crossbones+   -  Reputation: 2869

Like
1Likes
Like

Posted 27 January 2013 - 11:31 AM

Regardless of the API you end up using, my advice is still valid.


Niko Suni


#6 AquaMacker   Members   -  Reputation: 255

Like
0Likes
Like

Posted 28 January 2013 - 06:13 PM

end up using ?
pDevice->RSSetState( NULL ) ?

 

I don't understand what your saying...


Edited by AquaMacker, 28 January 2013 - 06:14 PM.


#7 Nik02   Crossbones+   -  Reputation: 2869

Like
1Likes
Like

Posted 29 January 2013 - 02:37 AM

Just before you draw your objects (at each frame), set all the states that affect the rendering of said objects. These include input assembler settings, rasterizer state, blend state, output merger state, shaders, views, textures, samplers, buffers, input layout (and some others). Rendering text usually sets some of these states, and in your case the font object isn't apparently resetting some of the states after drawing; this is why you need to do it.

For a small list of objects this may seem like overkill, but if you have many similar objects you can sort their rendering by the states they use (commonly known as "batching"). This potentially saves a lot of user->kernel transitions (driver calls) - those can eat your cpu cycles fast.

---

Note that if you use ID3DX10Font (this is not apparent in your code), you can use a sprite object that you previously allocated in order to store the font's render states. The sprite object uses a Begin/End pair; the Begin method lets you specify that upon calling End the device state is restored to pre-Begin state. So if you surround the font drawing with the Begin/End of its sprite, you can control whether or not it resets the state for you.

All that said, you can potentially save performance if you still do the state sets manually only when you actually do need to set them. You see, resetting takes the same time or more as setting.

Edited by Nik02, 29 January 2013 - 02:46 AM.

Niko Suni


#8 AquaMacker   Members   -  Reputation: 255

Like
0Likes
Like

Posted 29 January 2013 - 08:03 AM

Thank you Sooooooooooooooooo much !!!
I DO Remember your advice.

SO thank you ^^;;;




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS