Light mapping
Light mapping
Light mapping
Light mapping
Light mapping
Light mapping Light mapping Light mapping Light mapping Light mapping Light mapping Light mapping Light mapping
Light mapping Light mapping
Light mapping
Go Back  Xtreme Visual Basic Talk > > > > Light mapping


Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2006, 11:23 AM
Frisker Frisker is offline
Newcomer
 
Join Date: Nov 2005
Location: Malmo, Sweden
Posts: 19
Default Light mapping


Hello,

I've been working on a chess game, I use two lights to light up my chessboard and its chess pieces. I want my chess pieces to reflect shadows.
I've searched google and some forums for a time without finding any tutorial at all for Light mapping in VB.net

The code for lights
[VBCODE]
Private Sub CreateLights()
Device.Lights(0).Type = Direct3D.LightType.Directional
Device.Lights(0).Direction = New Vector3(0, -150, -150)
Device.Lights(0).Position = New Vector3(0, 150, 150)
Device.Lights(0).Enabled = True

Device.Lights(1).Type = Direct3D.LightType.Directional
Device.Lights(1).Direction = New Vector3(0, 150, 150)
Device.Lights(1).Position = New Vector3(0, -150, -150)
Device.Lights(1).Enabled = True
End Sub
[/VBCODE]

Here's how it looks at the moment
http://epicdesign.se/Simon/ChessShadows.jpg

I want it to look something like this
http://epicdesign.se/Simon/ChessShadows2.jpg

(Both pictures are using the same modells, the last one is in 3Dmax).

So, any1 know how I should add shadows (light mapping) to my chess project?
Reply With Quote
  #2  
Old 06-20-2006, 02:04 PM
ShadowWolf ShadowWolf is offline
Centurion
 
Join Date: Jan 2006
Location: Finland
Posts: 114
Default

Well, I'm trying to get lights to work myself, so I guess I'm not much help here. Got a post somewhere at the top, post there if you feel like helping. As for the shadows, I managed to find something that might point you in the right direction. I read about this while trying to get my lights working.

Shadows were made with effect files (.fx) in the C# and C++ samples Microsoft provided with the DirectX 9.0c SDK. This seems like a stupid way to do it, but obviously it works.

A rough view of what the fx file should contain (as I remember it):
1) shader parameters
2) drawing tiers/parts or similar (called from the code to draw something)
3) drawing ?technologies? (tier or part group?, also called from the code)
4) somekind of connection to the actual code, variable names match etc.

Edit: the effect file is loaded into a variable, something like this: DirectX.Direct3D.Effect*
* = anything, could be List, File.....
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
Light mapping
Light mapping
Light mapping Light mapping
Light mapping
Light mapping
Light mapping Light mapping Light mapping Light mapping Light mapping Light mapping Light mapping
Light mapping
Light mapping
 
Light mapping
Light mapping
 
-->