About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Light Point Shadow Casting
Author Message
AndrewBGS Offline
Member

Post: #1
Light Point Shadow Casting
I can't understand why my point of light isn't casting any shadows; In my light Point class DrawPrepare I have this:

LightPoint (15, T.pos(), Vec(1, 0.8, 0.8), 0, 0.5).add(0.5, this);

now as I understood, that .add(x,this) should set the opacity of the shadows cast by my light source to x. I think I'm missing something, but I couldn't figure what by looking at the lights tutorial. As for example project, none of them have point lights that actually cast shadows.

Idea... maybe I'm not returning what I should in the drawPrepare, or maybe I have to specifically do something with the renderer... I'm lost.
(This post was last modified: 07-03-2013 02:00 PM by AndrewBGS.)
07-03-2013 01:34 PM
Find all posts by this user Quote this message in a reply
gdalex Offline
Member

Post: #2
RE: Light Point Shadow Casting
Does your Point Light game object has the right value for the attribute "cast shadows" ?
07-03-2013 03:32 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Light Point Shadow Casting
If you mean a tick near the cast shadows bool parameter, yes. But in my code it doesn't look like that is taken into consideration anywhere. Nor in any example project I saw.

I checked the Game Objects code; the only point where that parameters IS considered is the parameter after .add(), the X in my example above. Which if true, is 1. Which I tried, and didn't work.

Update on that: I used 0.9. If I use 1, or true, as the first parameter of .add, The point isn't actually emitting light anymore. It's bright as hell, but nothing around it is lit anymore. When it's under 1 however, it light the surroundings very nice.

(I checked, the point is not inside an object or something s.t. it casts a shadow all around)

It sure DOES behave like the light is in the middle of an object however, beause the higher I set the shadow opacity the darker things get around my light point. But it's standing in air, and it's not even drawing anything anymore, it's just supposed to emit light and cast shadows.
(This post was last modified: 07-03-2013 05:31 PM by AndrewBGS.)
07-03-2013 05:12 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Light Point Shadow Casting
Perhaps:
-some object completely occludes your light
-the light range is too small to be visible
-you're not calling mesh.drawShadow in RM_SHADOW? (check game obj classes source code)
-you have some bug in the codes
07-04-2013 01:07 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #5
RE: Light Point Shadow Casting
Well, I can tell it's not one of the first two. As I said, with low shadow opacity the object does shed light on all nearby objects. I'm not sure about that RM_SHADOW; Doesn't that reffer to the DrawShadow function? That wokes, i.e. during the day (when the SUN is the light source) all shadows appear according to the sun. But during nighttime, these small light points don't create shadows.

I did think that it's possible to have some bug in the code, but that doesn't help a lot wink)

Ok so I'm a little noob about the renderer stuff, I'm working on functionality mainly, so I'm hoping it's the 3rd option; Anything I should do besides having the drawshadowing function in the objects? Actually, what IS the difference between the Sun and my light points? The Sun does cast shadows, why my light points can't?
(This post was last modified: 07-04-2013 04:01 PM by AndrewBGS.)
07-04-2013 03:49 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #6
RE: Light Point Shadow Casting
So I'm having a problem:
Tutorial Game Basics/ Lights and Particles - I have no light in this tutorial. Particles work, but nothing is lit. As I haven't touched this tutorial, and assume it should light up, I'd like to direct this question to Esenthel: What's wrong? (recently re-installed engine for some other reasons, and didn't help). What can I do to have my points cast shadow?

(well, my diagnosis is they DO cast shadow, but they behave as if light source is caught in an object, causing everything around to be in shadow)
07-07-2013 07:56 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #7
RE: Light Point Shadow Casting
A screenshot of this light-caught-in-object effect would be useful for tracking down the cause.
07-08-2013 08:39 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #8
RE: Light Point Shadow Casting
I can't provie one right now, I'll try later this evening. But there's nothing to show really.
Light point has shadow cast on --> no difference (as if light point didn't exist)
Light point has shadow cast off --> Area around light point is lit, but no shadows.

[Image: game_zpsa59e981e.png]

so here's how the light tutorial shows on my PC. Nothing changed. I'm told there should be light in it, apparently the default light with shadow version.
And, there's nothing. So I'm thinking there's an engine issue here.
(This post was last modified: 07-08-2013 11:13 AM by AndrewBGS.)
07-08-2013 10:31 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #9
RE: Light Point Shadow Casting
Yeah, there should be a spot of light next to the flame. That rules out code issues, if you haven't changed the tutorial.
Does 04 - Lights tutorial similarly have light missing?
Have you checked your graphics drivers and driver settings?
07-09-2013 02:05 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #10
RE: Light Point Shadow Casting
Nope, Game Basics/Lights works nice, 3 light points, 3 shadows for each ball....
I don't know what should I check about my graphics driver and settings, care to tell me please?
This is really starting to annoy me... I can't understand why I have this problem.
07-09-2013 07:48 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #11
RE: Light Point Shadow Casting
What graphics card are you using Andrew? In terms of the graphics driver I'd just ensure you have the latest installed and it's set to its default settings.
07-09-2013 08:25 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #12
RE: Light Point Shadow Casting
NVIDIA GeForce GT 504M, 2GB VRAM. If the simple lights tutorials renders shadows and lights correctly, doesn't it rule out my graphics card being an issue?
07-09-2013 08:37 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #13
RE: Light Point Shadow Casting
Not necessarily. The fact that the tutorial works for other people means there is something goofy at hand. Try downloading the latest NVidia driver to see if it makes any difference at all.
07-09-2013 08:55 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #14
RE: Light Point Shadow Casting
Done, downloaded, installed, restarted, no change. So that's off the list also.... great.
I'm really lost. It seems this occurs when loading light points from world, as the ones created in the simple Lights tutorial work. This doesn't give me any ideas though....
07-09-2013 09:27 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #15
RE: Light Point Shadow Casting
Hi,

Sorry for late reply,

Quote:I can't provie one right now, I'll try later this evening. But there's nothing to show really.
Light point has shadow cast on --> no difference (as if light point didn't exist)
Light point has shadow cast off --> Area around light point is lit, but no shadows.
yeah, there should definitely be a light there (in the "game basics/lights and particles" tutorial) assuming that you haven't modified it.

Is your GPU
Quote:NVIDIA GeForce GT 504M
or 540m?
Can you try different versions of the GPU driver?
Latest, and few olders?
Can you try following configurations:
1) Renderer.type(RT_FORWARD);
2) D.shadowMode(SHADOW_NONE);
3) manually apply lights using following code
Code:
void Render()
{
   switch(Renderer())
   {
      case RM_PREPARE:
      {
         LightPoint(50, Vec(16, 5, 16), Vec(1)).add();
07-22-2013 01:13 PM
Find all posts by this user Quote this message in a reply
Post Reply