Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1] 2
  Print  
Author Topic: global/sun light and shadows  (Read 597 times)
jerome2kph
Community Member
*
Posts: 58


« on: February 06, 2010, 12:59:18 PM »

I want to put a global/sun light to my project and able to cast shadows.
how will I do it in C#?
Logged
Toaster
Community Member
*
Posts: 293

Crap I burnt the toast! :P


WWW
« Reply #1 on: February 06, 2010, 03:17:03 PM »

With shadow gen once its released or you can use stencil shadows. Do a quick search on the forums on how to use stencil shadows, its not hard.

-Toaster
Logged

Visit my site at: Unknown Abstraction
Raul
Customers
Community Member
*****
Posts: 542

I like games.


WWW
« Reply #2 on: February 06, 2010, 03:22:47 PM »

BTW TOASTER

when will be the next version of shadowgen released?
Logged

Gamecode
Customers
Community Member
*****
Posts: 453


WWW
« Reply #3 on: February 06, 2010, 03:58:50 PM »

BTW TOASTER

when will be the next version of shadowgen released?

good question
Logged

aiR Captains - RC aircraft project TV65
Toaster
Community Member
*
Posts: 293

Crap I burnt the toast! :P


WWW
« Reply #4 on: February 06, 2010, 04:14:09 PM »

Soon very soon I hope. :p

-Toaster
Logged

Visit my site at: Unknown Abstraction
Raul
Customers
Community Member
*****
Posts: 542

I like games.


WWW
« Reply #5 on: February 06, 2010, 05:53:22 PM »

ontopic: directional lighting is what you need for "sun light"

offtopic: Toaster, we all waiting for that Cheesy
Logged

jerome2kph
Community Member
*
Posts: 58


« Reply #6 on: February 08, 2010, 10:57:40 AM »

when I export models on 3ds max, it has an option to include lightmap. can I use this instead of coding the lights? and does light map include shadows. do I still need to call the light engine to enable lightmapping?
Logged
jerome2kph
Community Member
*
Posts: 58


« Reply #7 on: February 08, 2010, 12:34:32 PM »

also, i got this error when putting a directional light.

AccessViolationException




click the image for actual size
« Last Edit: February 08, 2010, 01:00:07 PM by jerome2kph » Logged
Zaknafein
Customers
Community Member
*****
Posts: 2929


WWW
« Reply #8 on: February 08, 2010, 01:19:57 PM »

Well you need to do that after Init3DWindowed(). Can't do most things before the engine is inited.
Logged

jerome2kph
Community Member
*
Posts: 58


« Reply #9 on: February 08, 2010, 01:44:19 PM »

thanks zaknafein... but the light doesn't seem to have effect on the models... I've tried both point and directional. can you give me a full example/demo scene using lights? and about my question about lightmaps, can you explain it to me. I'm sorry for being a newbie. hehe.
Logged
Raul
Customers
Community Member
*****
Posts: 542

I like games.


WWW
« Reply #10 on: February 08, 2010, 03:23:49 PM »

Do you specify to your models what kind of light do you use?

Code:
TVMesh.SetLightingMode ( .... )
Logged

jerome2kph
Community Member
*
Posts: 58


« Reply #11 on: February 09, 2010, 12:00:53 AM »

thanks. I'll try it. anyway, about my question about lightmapping. will someone explain it to me.
Logged
asia
Customers
Community Member
*****
Posts: 79


« Reply #12 on: February 09, 2010, 03:12:51 AM »

Lightmaps are a second layer of textures added to your mesh. They will give you the shadows. Of course the shadow will be on the mesh itself. So you must have a lightmap for the floor or for the terrain. Lightmaps are good when the meshes are static (not moving).
There are several software for buiding lightmaps. I mainly use Giles which is free.
http://www.truevision3d.com/forums/companion_tools/lightmaps_and_giless_a_small_utility-t19575.0.html
Greeting
Fabio

Logged

Fabio Musmeci
ENEA
CR Casaccia
Via Anguillarese 301
00060 Rome
Italy
musmeci@enea.it
+39 3333934898
Learning to live better on a smaller footprint..
jerome2kph
Community Member
*
Posts: 58


« Reply #13 on: February 09, 2010, 05:36:39 AM »

how do I set the intensity/brightness of a point light?
Logged
jerome2kph
Community Member
*
Posts: 58


« Reply #14 on: February 09, 2010, 06:13:04 AM »

here are some of my lighting settings... the scene is so dark. can anyone suggest some proper parameter settings...

Code:
IDLight = Lights.CreateDirectionalLight(new TV_3DVECTOR(0, 300, 0), 1, 1, 1, "dir light", 1);

Code:
IDMat = Mats.CreateLightMaterial(1, 1, 1, 1, 0.15f, 1, "basic material");

Code:
iit.SetMaterial(IDMat, -1);
iit.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_NORMAL, 0, 1);

Logged
asia
Customers
Community Member
*****
Posts: 79


« Reply #15 on: February 09, 2010, 07:01:49 AM »

your light is pointing up...
The direction should be with a negative Y.
Also, because it is a direction it should be normalized (or "nearly" normalized). I suggest the following direction: -1,-1,1
Also the material stuff needs to be changed.
I think you should use creatematerial and all after al the setting like setabmient, setdiffuse etc. Try!
Also for the light you can set a lot of stuff!
Bye
Fabio
« Last Edit: February 09, 2010, 07:06:27 AM by asia » Logged

Fabio Musmeci
ENEA
CR Casaccia
Via Anguillarese 301
00060 Rome
Italy
musmeci@enea.it
+39 3333934898
Learning to live better on a smaller footprint..
asia
Customers
Community Member
*****
Posts: 79


« Reply #16 on: February 09, 2010, 07:14:09 AM »

I was thinking you may download the TV6.3. That is full of examples and many things are similar to TV6.5
Greetings
Fabio
Logged

Fabio Musmeci
ENEA
CR Casaccia
Via Anguillarese 301
00060 Rome
Italy
musmeci@enea.it
+39 3333934898
Learning to live better on a smaller footprint..
jerome2kph
Community Member
*
Posts: 58


« Reply #17 on: February 09, 2010, 09:22:54 AM »

isn't the first three parameters of TV_3DVECTOR the position of the light? is it the position or the direction.
I also noticed that when I set the 0.15f value to 1 in the CreateLightMaterial, the scene goes bright but it makes the light pointless because it's just like setting the lighting mode to none.
Logged
Raul
Customers
Community Member
*****
Posts: 542

I like games.


WWW
« Reply #18 on: February 09, 2010, 09:34:14 AM »

The first parameters could be the light pos or the light direction. A DIRECTIONAL LIGHT does not have any position... Smiley
Logged

jerome2kph
Community Member
*
Posts: 58


« Reply #19 on: February 09, 2010, 09:49:45 AM »

tnx  Smiley
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks