vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing
vb6, dx8 and texturing vb6, dx8 and texturing
vb6, dx8 and texturing
Go Back  Xtreme Visual Basic Talk > > > vb6, dx8 and texturing


Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2011, 11:33 AM
scorpionz scorpionz is offline
Newcomer
 
Join Date: Apr 2003
Location: lafayette/kaplan, la.
Posts: 1
Question vb6, dx8 and texturing


I'm having a problem with an onscreen texture that shows up fine on a modern graphics card but has odd artifacts on an older card..

If you look at the second screenshot, you will see a sort of wrapping ghost on the top and left edge of the hud image..

This is my hud texture:
http://xinroot.com/images/hud.tga

First computers specs:
1600x900
ati radeon hd 5770 1gb card
windows 7

http://xinroot.com/images/lucidhud1.jpg

Second computers specs:
1024x768
ati radeon 9200 pro 128mb card
windows xp

http://xinroot.com/images/lucidhud2.jpg

Setting up my device:
Code:
Public Sub SetupDevice()
    With D3DDevice
        .SetRenderState D3DRS_SHADEMODE, D3DSHADE_FLAT
        .SetRenderState D3DRS_FILLMODE, D3DFILL_SOLID
        .SetRenderState D3DRS_CULLMODE, D3DCULL_CCW
        .SetRenderState D3DRS_NORMALIZENORMALS, 0
        .SetRenderState D3DRS_ALPHABLENDENABLE, 0
        .SetRenderState D3DRS_ALPHATESTENABLE, 0
        .SetRenderState D3DRS_DITHERENABLE, 0
        .SetRenderState D3DRS_ZWRITEENABLE, 1
        .SetRenderState D3DRS_LIGHTING, 0

        .SetTextureStageState 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR
        .SetTextureStageState 0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR

        .SetTextureStageState 1, D3DTSS_MINFILTER, D3DTEXF_LINEAR
        .SetTextureStageState 1, D3DTSS_MAGFILTER, D3DTEXF_LINEAR
        .SetTextureStageState 1, D3DTSS_MIPFILTER, D3DTEXF_LINEAR

        .SetTextureStageState 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE
        .SetTextureStageState 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE

        .SetRenderState D3DRS_MULTISAMPLE_ANTIALIAS, 1
    End With

    D3DXMatrixPerspectiveFovLH matProj, Pi / 4, D3DWindow.BackBufferHeight / D3DWindow.BackBufferWidth, 1, 10000
    D3DDevice.SetTransform D3DTS_PROJECTION, matProj
End Sub
Texture load:
Code:
Set TexPool(numTextures).tex = D3DX.CreateTextureFromFileEx(D3DDevice, App.Path & "hud.tga", 0, 0, D3DX_DEFAULT, 0, CONST_D3DFORMAT, D3DPOOL_MANAGED, D3DX_FILTER_LINEAR, D3DX_FILTER_LINEAR, D3DColorXRGB(0, 0, 0), ByVal 0, ByVal 0)

DoHUD HUDTex, 269, 120, 0, CSng(D3DWindow.BackBufferHeight) - 12
And finally my drawhud sub:
Code:
Sub DoHUD(HUDTex As Long, imgWidth As Single, imgHeight As Single, posWidth As Single, posHeight As Single)
    If ShowHUD Then
        ScreenRect(0) = MakeTLvert(posWidth, posHeight - imgHeight, 0, 0)
        ScreenRect(1) = MakeTLvert(imgWidth, posHeight - imgHeight, 1, 0)
        ScreenRect(2) = MakeTLvert(posWidth, posHeight, 0, 1)

        ScreenRect(3) = MakeTLvert(posWidth, posHeight, 0, 1)
        ScreenRect(4) = MakeTLvert(imgWidth, posHeight - imgHeight, 1, 0)
        ScreenRect(5) = MakeTLvert(imgWidth, posHeight, 1, 1)

        With D3DDevice
            .SetVertexShader TLV_FVF

            .SetTexture 0, TexPool(HUDTex).tex
            .SetTexture 1, Nothing

            .SetRenderState D3DRS_MULTISAMPLE_ANTIALIAS, 0
            .SetRenderState D3DRS_ALPHABLENDENABLE, 1
            .SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
            .SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA

            .DrawPrimitiveUP D3DPT_TRIANGLELIST, 2, ScreenRect(0), Len(ScreenRect(0))

            .SetRenderState D3DRS_MULTISAMPLE_ANTIALIAS, 1
            .SetRenderState D3DRS_ALPHABLENDENABLE, 0
        End With
    End If
End Sub
Reply With Quote
Reply


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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing vb6, dx8 and texturing
vb6, dx8 and texturing
vb6, dx8 and texturing
 
vb6, dx8 and texturing
vb6, dx8 and texturing
 
-->