Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > DirectX > Textures VS materials


Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2006, 07:02 AM
parduz parduz is offline
Newcomer
 
Join Date: Nov 2003
Location: Italy
Posts: 17
Default Textures VS materials


I have a mesh (.x file) that have a "base" materials, and only some faces textured, for wich i've built a 256x256 bmp with the "base" material color as a "background" and the details in other color.
This leads me in 2 problems:
1) the non textures part of the mesh seems really different from the textured one: the "raw" material looks like plastic (some shiny faces, etc) while the textured part seems much more opaque, less "reflective".... basically it seems like a carpet on a "gloss" surface.
As now, the only solution i've found is to make a little texture with only the "base" color that i apply at the part that shold not need that, just to keep the thing "similar". How can i better "couple" a material with a texture?

2) The texture colors differs (are "blended") when i change the base material color: i was expecting that the texture will "cover" the faces regardless for the material color. There's a way to make the texture full opaque, and not "semi-transparent" as it appears now?

Thanks
Reply With Quote
  #2  
Old 03-30-2006, 04:33 AM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Thumbs up Mesh Subsets

i had this problem too, the way to overcome it is to draw the mesh subsets seperatley, obviously you have to get the number of subsets before you can use this this is easily done when you load the mesh, the maxlimbs

The best thing about drawing the subsets seperately is that you can apply different transforms, materials, textures, lighting, basically treating them as seperate meshes.

The code is simplfied but basically works.

Code:
    Dim Materials as D3DXBuffer, Adjaceny as D3DXBuffer, MaxLimbs as Long

    Set Mesh = Dx8D3D.LoadMeshFromX(File, D3DXMESH_MANAGED, Dx8Device3D, Adjacency, Materials, MaxLimbs)

    With Mesh
            Dim C As Long
            For C = 1 To MaxLimbs
                 'Add draw code here
                 
                .DrawSubset C
            Next C
    End With
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
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
 
 
-->