[UPDATE] Billiards game - lighting issues

UPDATE:
I tried sun lights as suggested, but the issue persists where the lights dim depending on cue stick pitch. Also noticed that one or more balls rolling causes them to dim in and out, depending on their orientation but I have not determined which balls specifically cause it (if not all or just the cue ball).

Any help is greatly appreciated…Below is the original post.

Hello,

Just having a few issues I’ve not been able to work out via Google or the forums. Hoping someone can help me troubleshoot a bit - it’s probably user error. This is only my first week or so in Blender…

First issue is to do with lighting. When the camera and cue stick are within certain ranges of positions, my spot lights dim on the floor… What the following screenshots can’t show is that the lighting changes fluidly with the cue stick pitch. The 2nd image is expected lighting.



Also note that if I rotate the camera slightly (it is an orbital cam, parented to an empty that actually does the rotation), the issue goes away again.

[SOLVED, I think - had to decrase “bias” setting on lights] Second, I notice that the lighting isn’t as nice when I run the game, as it is in the editor…note the soft shadows around the rails and overall more realistic appearance:


Even when the game first runs, with the camera in that position, that nice softness goes away. This is not as big of a deal, but would be nice to make the editor more closely match the game if possible…

Last is a collision issue, where the cue ball will occasionally fly off in a wrong direction (up to almost 90 degrees sometimes). It seems to be independent of how hard the cue ball is struck, or it’s orientation, etc.

You can find the GIT repo containing the project file here: https://[email protected]/experimentfailed/a-bit-of-billiards.git

Thank you very much for reading!ligh

Hello,

look, I am not very experienced, but my personal estimation =

  1. Nice controllable shadows and lighting are produced by the Sun type.
    I have created a whole game with nice shadows just by using a single Sun (Isometric Tanks, see below)
    Usually professionals create three lights, of which only one casts shadows
    (this is important for efficiency reasons, do not put a lot of shadow casting lights,
    it will slow your game down)

So perhaps try the Sun light.
Watch some YouTube videos about BGE lighting, they are very helpful.

  1. I would absolutely 100% NOT rely on the engine for such a demanding calculation.
    Engine collision works well for a character to bump into a wall, or fall off a cliff, etc.
    The billiards bounce has too much detail for the engine to handle.

You must implement it yourself I believe. The basic idea is to use the line that connects
the centers of the two balls. One bounces along that line, the other perpendicular to it.

http://www.real-world-physics-problems.com/images/physics_billiards_1.png

Thanks very much for your reply!

My understanding from watching one video was that the Sun light did not cast shadows (which honestly seemed odd, but not enough to make me check, I guess). I will definitely give it a try!

For the physics, I’ve had a chance to do a lot more work & testing since I posted this. So far ball to ball collisions actually seem pretty good (really, good actually - definitely playable). The rails feel pretty dead so some code might be needed there, and I’ve not quite dialed in friction perfectly yet. Nevertheless, you’re the 2nd person to say this. I’d like to have good spin modeling (and even jump, if possible) and that makes the problem considerably more difficult, so I’m going to try to let the physics engine do as much of the heavy lifting as possible, and it doesn’t look hopeless.

Also, I spied your game in the completed projects section and it looks enticing - I’ve just been too engrossed in this to give it a try, but definitely planning to check it out!

Hello, sorry for long time to reply :frowning:

Unfortunately I can not understand what the lighting issue is. Will try to download the game and see.

Good luck, it is a good choice of a game, I wish you success

No need to apologize for delayed reply! Free help is free help, and I greatly appreciate any insight.

Also, it may be that the version in the repo is broken right now, but hopefully works enough to see the lighting issue, should you (or anyone) happen to take a look. I’ll push the latest version later tonight to be sure.

Thanks again!