Replies: 4 comments 6 replies
-
Godot can already support such small scales. If you resize everything to be 10 times smaller, you need to adjust your collision safe margins to be 10 times smaller than they would otherwise be. For shadows, you need to reduce Shadow Max Distance on the DirectionalLight3D node by a 10× factor and also decrease bias by a 10× factor (but not normal bias, if I'm not mistaken). That said, there is absolutely no problem with using a much greater gravity scale than the default. If you can't use meters as units, this won't cause any problems in practice as long as you take this into account within your game logic.
Floating-point precision is always relative to the scale you're working in, so that wouldn't be useful. If you make everything 100× larger but everything moves 100× faster, the amount of effective precision you're getting is pretty much the same. |
Beta Was this translation helpful? Give feedback.
-
Increasing the physics framerate to something like 120 or 240 will help as well, but be aware of #1893 |
Beta Was this translation helpful? Give feedback.
-
Using 4.3 and confirming that Godot can't still handle shadows on small scenes. On a scene laid out on a 1-meter tile, the shadows are very poor. You have to manipulate the DirectionalLight3D controls to get shadows to appear at all, and even when you do, they're so bad you wouldn't want to use them anyway. Scale the entire scene by 10, and the shadows are better, but still not great. Scale the entire scene by 100, and the shadows are quite good. A few commenters here and on the godotforums eg https://godotforums.org/d/30238-shadows-arent-cast-properly-from-small-objects/4 have said very few people would want to do a small scene, but obviously some people do!!! In my case the only reason to scale up the scene is to get the shadows to work. It increases the complexity of the rest of the program having to factor in the scale change, all for the sake of the shadow algorithm. There's no other reason. Also it really shouldn't matter: If your camera's view area is small enough, the shadow calculation sizes should be adjusted accordingly. There must be something in the Godot shadow algorithm which is hardcoded for a fairly large scene size. |
Beta Was this translation helpful? Give feedback.
-
The tile is 1m and the trees about the same size as your spheres, but since their shadows are cast by from texture billboards they'd obviously be much thinner, and perhaps so blurry they're hard to discern. No amount of tweaking the Light Shadow settings (could sharpen those shadows???) to get anything close to the 100X scale quality. I did try a 10X scale version too and consistent with that, found that although sharper, it was still a bit too blurry. So, yes, Think you are right!
|
Beta Was this translation helpful? Give feedback.
-
This stems from a game I was making where a small ball rolls around in a maze using just the force of gravity and the tilt of the box. At first, the behavior seemed unrealistic because the ball was moving much too slowly. Then I realized that this was due to the fact the scale was wrong - my ball was 1m in diameter and was moving correctly for a ball that size. But since both a large ball and a small one will fall at exactly the same rate due to gravity, a 1m ball viewed from 10 m away will roll much differently than a 1 cm ball viewed from 10 cm away.
So I shrunk my size down to be 1/10 what it originally was, but then started running into new problems. The physics engine has glitches for 0.1m radius spheres and seems to break down even worse for even smaller objects that are 0.01m. Cast shadows are also a problem - while my directional light casts shadows correctly for 1m tall objects, the shadows are mostly missing for 0.1m tall objects.
I've already had some discussions about this on the Godot forums:
https://godotforums.org/d/30223-how-to-make-a-rigidbody-roll-more-quickly/8
https://godotforums.org/d/30238-shadows-arent-cast-properly-from-small-objects/4
I feel trying to create games that work on centimeter scales is something that many would be interested in, and in my case gravity just doesn't accelerate objects properly if I'm limited to 1m objects. If it's a question of resolution, it would be nice if you could provide a hint to the physics and lighting engines that your entire scene fits in a 10m cubed region.
Beta Was this translation helpful? Give feedback.
All reactions