Shadow Question
Shadow Question
Shadow Question
Shadow Question
Shadow Question
Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question
Shadow Question Shadow Question
Shadow Question
Go Back  Xtreme Visual Basic Talk > > > > Shadow Question


Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2009, 12:57 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default Shadow Question


I've been looking for a good tutorial on using shadows(volume or mapping) in vb .net with direct3d. I have found several tutorials that us c++ or c# but I'm still a novice with both those languages so I can't make much sense of them. Anyone here know a good place to learn about shadows in vb .net , specifically using meshes not just simple shapes tyvm
Reply With Quote
  #2  
Old 04-19-2009, 05:18 PM
Qua's Avatar
QuaShadow Question Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

C# and VB.NET is very much alike in syntax - or at least in the calls made to the DirectX 9c wrapper classes. So you should be capable of reading a C# tutorial and rewrite it in VB.NET. If you're finding this unlikely hard, then there are translators that can do this job for you.

Personally I would recommend these two tutorials which are very informative, but written in C#. Riemer - Shadow Mapping & Reimer - The First Shadow.

It's my impression that C# is one of the 'hottest' languages at the moment, and possibly also the language with most information and tutorials online - At least when working with DirectX. For that reason I would seriously recommend that you familiarize yourself with at least the syntax of the language so you actively can read and understand the language. If you search google for resources about DirectX respectively for c++, c# and VB.NET, you'll find that the C# search produces 10 times the amount of hits that c++ does, and almost twice as many as VB.NET.
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #3  
Old 04-19-2009, 06:01 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default Xna :p

These are good tutorials but there is one problem , they are for XNA. XNA is like a wrapper for directx and has a lot of functions that directx doesn't have plus it works different in rendering as well. TY anyways I'll keep looking , maybe it's time to learn c# :>
Reply With Quote
  #4  
Old 04-19-2009, 06:46 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default C++ or C#

ok I've found some of the stuff there helpful but I'm at a fork in the road now. Should I learn C# next of C++. I seen that in the new dx10 sdk it only has support for C++ , how ever I don't have windows vista(thankfully) so I'm not sure if dx10 can be used in vb or C# .net , most of the C# stuff seems to be in XNA no pure directX. I want to use dx no a library based on it. Anyone have any thoughts on this subject :P ty
Reply With Quote
  #5  
Old 04-20-2009, 02:26 AM
Qua's Avatar
QuaShadow Question Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

The two articles I linked to was purely DirectX - they did not make use of the XNA framework.

As far as I know there are no plans at the moment for Microsoft to built a managed wrapper around DX10. I could imagine this being the fact because most commercial games are built with C++ or VC++. There are a few wrappers for DX10, but I'm not sure how well they work, and to be honest then learning c++ is properly better than relying on some open source wrapper for the current version of DX.
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #6  
Old 04-22-2009, 09:34 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default

perhaps I didn't look through them thoroughly enought but I seen a lot of function I know aren't part of directx. This could be some stuff built earlier in the article. That is besides the point. I think I'm going with C++ for now and though I plan on working all my findings into both C++ and VB .net also I'm going to probably post my own site with simple more understandable instruction so keep an eye out :P happy seasons

Quote:
You kill a man you are a murderer , you kill many men you are a conquerer , you kill them all and you are a god
Reply With Quote
  #7  
Old 05-08-2009, 12:35 PM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Default

if you are a novice i suggest you start with C# it has nearly all the power of c++ but with the ease of VB, then should you feel ready for c++ then its just a simple step over since the format is very nearly the same.
Learn how to creat the objects and use them with C# & Dx9 then move over to Dx10 as its more advanced than Dx9.
Dx10 is great however i tried running it on my machine with vista but it buggered up everything, so i recomend sticking with Dx9 untill they get it fixed properly.

Well thats my opinion anyway, you can always try for yourself and see what you are comfortable with.

As for shadows there is a very simple way of drawing shadows using a sadow matrix, it quick and providing you're game isn't that advanced does the job well. Search this forum for more details.
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
Reply With Quote
  #8  
Old 05-21-2009, 10:09 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default

k well I've got shadows. Now I'm having trouble with getting the matrix projections right. My shadows are cast in weird directions. Anyone know of any good tutorials on the math for this I'm bit rust been out of school for a while now ty.
Reply With Quote
  #9  
Old 05-22-2009, 05:23 AM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Default

most likely the light is inside the mesh or somesort of postion error.

you have to choose a different light type, cos this can affect it also.

set the W parameter in the Vector4 according to the light type.

the code is in c# but it the same process in vb.net
it show you how to create a shadow matrix correctly

Code:
                    Vector4 v4Light = new Vector4(); Matrix matShadow = new Matrix(); Light L = new Light;
                    
                    switch (L.Type)
                    {
                        case LightType.Directional:
                            v4Light.W = 0;
                            break;
                            
                        case LightType.Point:
                            v4Light.W = 1;
                            break;
                            
                        case LightType.Spot:
                            v4Light.W = 2;
                            break;
                    }
                    v4Light.X = L.Position.X;
                    v4Light.Y = L.Position.Y;
                    v4Light.Z = L.Position.Z;
                    
                    matShadow.Shadow(v4Light, P);
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
Reply With Quote
  #10  
Old 05-22-2009, 12:12 PM
Chris Ara Chris Ara is offline
Centurion
 
Join Date: Feb 2005
Posts: 176
Default

Hehe the light was in the mesh plus I had two positives that should have been negatives. My next thing will be to work on shadow mapping. Volume shadows are great but the are really proccessor intensive. Then on to animation again. I'm working a DLL for making simple 3d games. I already have where you can load meshes , create lights and shadows in just a few lines of code and everything is automatically added into the scene , so you just call render . Animation is my last step then I'll go back and tweak the engine. Plus I got some decent collisiont detection too. I'm learning C# so I can write the DLL in bot VB and C#. I might release the DLL soon and see if I can get any help on the project :>
Reply With Quote
  #11  
Old 05-23-2009, 03:11 PM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Default

yeah volume shadows take up over half of the cpu time. shadow mapping is driving me crazy also, however animation in vb/c# is really simple, much easier than VB6, you WILL need this pdf to understand the different GUIDs in the xfile are for so you what data to load. trust me its an extremely usefull file.

http://www.xmission.com/~legalize/book/download/21-X%20Files.pdf

simple break down basically if its a frame open the frame get child count, cycle thru children till end then leave frame, get next data. be aware some frames also contain other frames, so stacking WILL happen. ....t looks like alot now, but you'll get it.

or u can just use Dx9 inbuilt AnimationSet class to control it, which i discovered after i wrote my own, you can imagine how annoyed i was then.
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!

Last edited by Leade; 05-23-2009 at 03:28 PM.
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
Shadow Question
Shadow Question
Shadow Question Shadow Question
Shadow Question
Shadow Question
Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question Shadow Question
Shadow Question
Shadow Question
 
Shadow Question
Shadow Question
 
-->