strange behaviour of (fps of) d3d app (and D3DXFONT)

strange behaviour of (fps of) d3d app (and D3DXFONT)

Post by Jan Hammerschmid » Tue, 01 Jul 2003 09:44:30



hi,

i have a d3d app, running in windowed mode, which does (almost) zero cpu
work, while using the gpu to draw some (preprocessed) data (task manager
says, cpu load is at 0%) and DX for mouse & keyboard input (can fly around,
for example)

ok, if i dont use the DrawTextA-Function of the D3DXFONT, i get about
150fps, BUT if i use the mouse to "look" around, it feels "laggy" most of
the time.
if i draw the last 5 fps values with DrawTextA (one line, cpu load still at
0%), the same behaviour. (<- scenario 1)
then, if i add some more information to the string, i draw with DrawText (4
lines, but same function-call as before), the cpu load goes up to 100% AND
the framerate goes up to about 600 or 700fps (!) (<- scenario 2)

now another strange thing: when i make another DrawTextA-call before the
"fps-status"-call in scenario 1, the cpu load goes up to 100% and the
framerate as well (like in scenario 2), but if i do this in scenario 2, cpu
load is again 0% and the framerate is only ~60fps.

i dont know, if all this font-drawing is that important, but one thing is
quite obvious: if the cpu load goes up, the framerate goes up as well and if
it's zero, the input is laggy, despite of the (still high) fps.
as the cpu load in fullscreen is always 100%, i get a constant good
framerate and it's smooth all the time in fullscreen mode

instead of drawing text to get the cpu load up (in windowed mode), i can
also put a Sleep(1) into the Render() function, which let the framerate drop
to about 60, but it runs smoother than without it.

final question: what could be the reason for this strange behaviour ?

 
 
 

strange behaviour of (fps of) d3d app (and D3DXFONT)

Post by Robert Dunlop [MS MVP » Wed, 02 Jul 2003 10:40:00


For several reasons, this sounds suspiciously like an issue with your
message processing loop.  How are you handling the main loop, and where
does your rendering function get called from?

--
Robert Dunlop
The X-Zone
http://www.directxzone.org/
Microsoft DirectX MVP
-------------
The opinions expressed in this message are my own personal views and do
not reflect the official views of the Microsoft Corporation.
The MVP program does not constitute employment or contractual obligation
with Microsoft.


Quote:> hi,

> i have a d3d app, running in windowed mode, which does (almost) zero
cpu
> work, while using the gpu to draw some (preprocessed) data (task
manager
> says, cpu load is at 0%) and DX for mouse & keyboard input (can fly
around,
> for example)

> ok, if i dont use the DrawTextA-Function of the D3DXFONT, i get about
> 150fps, BUT if i use the mouse to "look" around, it feels "laggy" most
of
> the time.
> if i draw the last 5 fps values with DrawTextA (one line, cpu load
still at
> 0%), the same behaviour. (<- scenario 1)
> then, if i add some more information to the string, i draw with
DrawText (4
> lines, but same function-call as before), the cpu load goes up to 100%
AND
> the framerate goes up to about 600 or 700fps (!) (<- scenario 2)

> now another strange thing: when i make another DrawTextA-call before
the
> "fps-status"-call in scenario 1, the cpu load goes up to 100% and the
> framerate as well (like in scenario 2), but if i do this in scenario
2, cpu
> load is again 0% and the framerate is only ~60fps.

> i dont know, if all this font-drawing is that important, but one thing
is
> quite obvious: if the cpu load goes up, the framerate goes up as well
and if
> it's zero, the input is laggy, despite of the (still high) fps.
> as the cpu load in fullscreen is always 100%, i get a constant good
> framerate and it's smooth all the time in fullscreen mode

> instead of drawing text to get the cpu load up (in windowed mode), i
can
> also put a Sleep(1) into the Render() function, which let the
framerate drop
> to about 60, but it runs smoother than without it.

> final question: what could be the reason for this strange behaviour ?


 
 
 

strange behaviour of (fps of) d3d app (and D3DXFONT)

Post by Jan Hammerschmid » Thu, 03 Jul 2003 03:31:46


i have only one "endless" loop, where both windows-messages are processed
and the rendering function are called from. basically it looks like this:

for ( ; ; )
{
    while (PeekMessage( &msg, NULL, 0, 0, PM_REMOVE))
    {
        TranslateMessage( &msg );
        DispatchMessage( &msg );
        if (msg.message == WM_QUIT)
            return;
    }
    // some DInput stuff (mouse / keyboard ->GetDeviceState())
    Update(); // processing DInput Data, etc., no rendering
    Render(); // BeginScene, some rendering, EndScene and Present

Quote:}

p.s.: sorry for having mistaken the "answer" button for the "answer
newsgroup" button :>



> For several reasons, this sounds suspiciously like an issue with your
> message processing loop.  How are you handling the main loop, and where
> does your rendering function get called from?

> --
> Robert Dunlop
> The X-Zone
> http://www.directxzone.org/
> Microsoft DirectX MVP
> -------------
> The opinions expressed in this message are my own personal views and do
> not reflect the official views of the Microsoft Corporation.
> The MVP program does not constitute employment or contractual obligation
> with Microsoft.



> > hi,

> > i have a d3d app, running in windowed mode, which does (almost) zero
> cpu
> > work, while using the gpu to draw some (preprocessed) data (task
> manager
> > says, cpu load is at 0%) and DX for mouse & keyboard input (can fly
> around,
> > for example)

> > ok, if i dont use the DrawTextA-Function of the D3DXFONT, i get about
> > 150fps, BUT if i use the mouse to "look" around, it feels "laggy" most
> of
> > the time.
> > if i draw the last 5 fps values with DrawTextA (one line, cpu load
> still at
> > 0%), the same behaviour. (<- scenario 1)
> > then, if i add some more information to the string, i draw with
> DrawText (4
> > lines, but same function-call as before), the cpu load goes up to 100%
> AND
> > the framerate goes up to about 600 or 700fps (!) (<- scenario 2)

> > now another strange thing: when i make another DrawTextA-call before
> the
> > "fps-status"-call in scenario 1, the cpu load goes up to 100% and the
> > framerate as well (like in scenario 2), but if i do this in scenario
> 2, cpu
> > load is again 0% and the framerate is only ~60fps.

> > i dont know, if all this font-drawing is that important, but one thing
> is
> > quite obvious: if the cpu load goes up, the framerate goes up as well
> and if
> > it's zero, the input is laggy, despite of the (still high) fps.
> > as the cpu load in fullscreen is always 100%, i get a constant good
> > framerate and it's smooth all the time in fullscreen mode

> > instead of drawing text to get the cpu load up (in windowed mode), i
> can
> > also put a Sleep(1) into the Render() function, which let the
> framerate drop
> > to about 60, but it runs smoother than without it.

> > final question: what could be the reason for this strange behaviour ?

 
 
 

1. D3D-Primit.: Clipping drops Fps

Hi,

I'm using Direct 3D Immediate Mode, the Drawprimitive way.
I'm currently rendering one single object, about 2500 faces.
I use the D3DVERTEX structure, so I let D3D do all
geometry-transforms, lighting and unfortunately clipping.

As longs as my objects is rendered to the middle of the screen
everything goes right, but as soon as some polygons touch the
screen border, the framerate drops down from 25 fps to 6 fps !!

I can't believe that the D3D Clipping Routines are that bad ???
My Viewport is set to the normal sample values ...
I haven't changed anything using setClipStatus();
(Most experiments using ClipStatus doesn't changed anything ...
 even if I use the NO_CLIP Flag in the render call there is no
difference.)
I use a Victory Erazor with a Riva 128 Chip.

Please help ...
and please send me a carbon copy via email.

Thank you,

        Stefan Wundrak

2. References wanted for rendering text characters in 3D

3. Strange behaviour of text in POV

4. Height Fields II

5. Strange behaviour of PowerPC PS2.5.1 Plug-In

6. Need help from vgl/vistool users

7. dmconvert: Strange behaviour

8. strange video behaviour

9. strange behaviour

10. Strange Performer behaviour

11. Strange flatpanel behaviour

12. strange mediaplayer behaviour