mesh not lit
mesh not lit
mesh not lit
mesh not lit
mesh not lit
mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit
mesh not lit mesh not lit
mesh not lit
Go Back  Xtreme Visual Basic Talk > > > > mesh not lit


Reply
 
Thread Tools Display Modes
  #1  
Old 07-01-2006, 03:53 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Question mesh not lit


I have a mesh I want to render with a light in the scene. I have tested the code for the lighting on a vertex buffer I made with just a square and the lighting worked perfect. I used the code to setup the lights to light a mesh but the light does not show up at all. Can anyone explain why this happens?

thanks
Reply With Quote
  #2  
Old 07-02-2006, 05:19 AM
Iceplug's Avatar
Iceplugmesh not lit Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Make sure the mesh has a material... though it could be other things like lighting disabled or not adequate enough to light the mesh, ZBuffers disabled, DepthStencils disabled, etc.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 07-02-2006, 05:59 AM
ShadowWolf ShadowWolf is offline
Centurion
 
Join Date: Jan 2006
Location: Finland
Posts: 114
Default

Yeah you need to calculate the normals... maybe this code will help (copied from one of my projects):

Code:
    Public Sub CalculateNormals(ByRef Mesh As Direct3D.Mesh, ByVal Dev As Direct3D.Device)
        Dim tmpMesh As Direct3D.Mesh

        tmpMesh = Mesh.Clone(Mesh.Options.Value, Mesh.VertexFormat Or Direct3D.VertexFormats.Normal, Dev)
        tmpMesh.ComputeNormals()
        Mesh.Dispose()
        Mesh = tmpMesh
    End Sub
Edit, oh and, if your using point or spot light then they might not work even if your graphics card supports dx9 and all its features like my radeon 9800 pro does. The solution to that is to create the device with SoftwareVertexProcessing instead of HardwareVertexProcessing.
Reply With Quote
  #4  
Old 07-06-2006, 04:06 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default

No it is still not working I tryed calculating the normals and made sure all the lighting was on and the buffers set up correctly. The lighting only woks with a customvertex buffer. For some reason it will not light the mesh could some one please show me a tutorial on how they did it or maybe a site I can visit that will explain lighting more in depth.

thanks
chris ara
Reply With Quote
  #5  
Old 07-07-2006, 02:12 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Could you post your code? I helped ShadowWolf with his lighting problem, I may be able to do the same for you.
__________________
Cheers
Reply With Quote
  #6  
Old 07-21-2006, 05:32 AM
ShadowWolf ShadowWolf is offline
Centurion
 
Join Date: Jan 2006
Location: Finland
Posts: 114
Default

Quote:
Originally Posted by ardman
Could you post your code? I helped ShadowWolf with his lighting problem, I may be able to do the same for you.
Even if the code I made for a test of mine was not too successfull when it comes to lights (my thread), it still lit the meshes. I see it's a long time since anyone posted in this thread but if you still need help Chris Ara then I could send you the whole source code of my "little" test.
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
mesh not lit
mesh not lit
mesh not lit mesh not lit
mesh not lit
mesh not lit
mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit mesh not lit
mesh not lit
mesh not lit
 
mesh not lit
mesh not lit
 
-->