Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Low FPS?  (Read 1106 times)
RayonMazter123
Customers
Community Member
*****
Posts: 104


« on: July 04, 2007, 05:34:19 PM »

I don't have an up to date gamer system anymore, but i'm finding something odd, that maybe I never noticed in the past.

When I render an empty screen (only showing fps), with the mouse on the form (vb6), I get a max of 70fps. This goes for both 6.2 & 6.5

When I code the same empty screen (only rendering out the fps text) in pure dx8, I get around 500-1000 fps, with the exact same window..

Code:
Private Sub Form_Load()

    Set TV = New TVEngine
    TV.Init3DWindowedMode hWnd, False
    Set Scene = New TVScene
    TV.DisplayFPS = True
    frmMain.Show
    bDoLoop = True
   
    Do
        TV.Clear False
        TV.RenderToScreen
        DoEvents
    Loop

    Set TV = Nothing
    End
End Sub


Any reasoning behind this?
Logged
serial
Customers
Community Member
*****
Posts: 299


« Reply #1 on: July 04, 2007, 06:19:12 PM »

probably want to post your pure DX8 code as well.  Maybe something you are doing in there
Logged
serial
Customers
Community Member
*****
Posts: 299


« Reply #2 on: July 04, 2007, 06:19:55 PM »

Whooop,  double posted.  :p
Logged
RayonMazter123
Customers
Community Member
*****
Posts: 104


« Reply #3 on: July 04, 2007, 11:47:29 PM »

Code for same effect in dx:

Code:
Dim bRunning As Boolean
Dim D3DX As D3DX8

'#########
'## FONTS ##
'#########
Dim MainFont As D3DXFont
Dim MainFontDesc As IFont
Dim TextRect As RECT
Dim fnt As New StdFont

'####FPS#######
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim FPS_LastCheck As Long
Dim FPS_Count As Long
Dim FPS_Current As Integer

Public Dx As DirectX8
Public D3D As Direct3D8
Public D3DDevice As Direct3DDevice8

Public Function Initialise() As Boolean
    On Error GoTo ErrHandler:
   
    Dim DispMode As D3DDISPLAYMODE
    Dim D3DWindow As D3DPRESENT_PARAMETERS
    Set Dx = New DirectX8
    Set D3D = Dx.Direct3DCreate()
    Set D3DX = New D3DX8
   
    D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode
    D3DWindow.SwapEffect = D3DSWAPEFFECT_COPY
    D3DWindow.BackBufferFormat = DispMode.Format
    D3DWindow.BackBufferWidth = 1024
    D3DWindow.BackBufferHeight = 768
    D3DWindow.hDeviceWindow = frmMain.hWnd
    D3DWindow.Windowed = 1
    Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)

   
    Initialise = True
    Exit Function
ErrHandler:
    Initialise = False
End Function

Public Sub Render()

    D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 1#, 0
    D3DX.DrawText MainFont, D3DColorRGBA(255, 255, 255, 255), CStr(FPS_Current) & "fps", TextRect, DT_TOP Or DT_LEFT
    D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0


End Sub

Private Sub Form_Click()
    bRunning = False
End Sub

Private Sub Form_Load()
   
    Me.Show
    Me.Left = 0
    Me.Top = 0
    bRunning = Initialise()
    InitFont
    TextRect.Top = 0
    TextRect.bottom = 200
    TextRect.Right = 500

    Do While bRunning
   
        Render
        If GetTickCount() - FPS_LastCheck >= 1000 Then
            FPS_Current = FPS_Count
            FPS_Count = 0
            FPS_LastCheck = GetTickCount()
        End If
        FPS_Count = FPS_Count + 1
        DoEvents
       
    Loop

    On Error Resume Next
   
    Set D3DDevice = Nothing
    Set D3D = Nothing
    Set Dx = Nothing
    Unload Me
    End
End Sub

Sub InitFont()
    fnt.Name = "Arial"
    fnt.Size = 12
    Set MainFontDesc = fnt
    Set MainFont = D3DX.CreateFont(D3DDevice, MainFontDesc.hFont)
End Sub



The D3DX.DrawText is very well known for being slow as well, i'm sure tv3d uses something better for rendering the fps out, yet the frames are horrible in tv3d on a blank screen.

Dx code: around 800fps
Tv3d: < 70 fps (both 6.5 and the previous 6.2)

My graphics card is an older 128mb Radeon 9200se agp 8x, on a 1.8ghz amd64 cpu.
On many 3d games I still get 80-200fps.
The problem seems to be with when the mouse is on the form. Tv3d does too much work just with the mouse on the render screen or something.

A lot of my community (customers if you will) don't have any better than the graphics card I have, therefore if that's the max fps I actually get, then I have a problem. Maybe i'll test a couple other engines out there and see the frame rate.

Thanks for taking the time.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks