Comments (5)
We shouldn't default to such a high range. Every scene i've worked on I've had to manually go reduce the range to something reasonable (oftentimes less than 10).
With proper inverse square falloff, a light with a brightness of 1 won't be visible beyond 20 meters or so (even if the range is significantly higher than that).
We used to calculate attenuation based on range and intensity. Now we don't touch attenuation because GLTF doesn't have a setting for it. This is a bit of a problem. Godot defaults to a linear falloff (attenuation = 1) so lights imported from GLTF are effectively imported with a linear falloff.
If we assigned GLTF lights a proper inverse square falloff (attenuation = 2), then we could easily cap their range at 100 or so when no range is specified (and then scale up the range when there is more intensity). At that range, there would be no visible difference with an increased range. However, with a linear falloff, we need a much larger range before we can cap it.
Technically, we are not compliant with the GLTF spec right now since GLTF lights are not using the inverse square law.
I suggest we do the following:
- Import lights with an attenuation of 2 when importing from GLTF
- Default to a range of 100. If intensity is specified, but range isn't scale up range based on intensity (I suggest increasing by a factor of
clamp(intensity / 100.0, 1.0, 40.96)
as below 100 intensity a range of 100 is fine, then it should scale up linearly after that until a max of 4096)
Of course switching to inverse square falloff will technically break compatibility, but we are not compliant with the spec right now. So I think the breakage is justified.
from godot.
Perhaps if the imported glTF doesn't provide a range value it should use Godot's default light range instead of an abnormally high one
If the light is meant to have infinite range in the source glTF, I wouldn't make it use Godot's default range, but a hardcoded value that is higher (probably between 100 and 250). I'd also only do this for lights with shadows enabled, as lights with very high ranges render correctly when shadows are disabled.
from godot.
I'd also only do this for lights with shadows enabled
That might be a problem because blender doesn't export shadow state, it doesn't even seem to be a part of glTF from what I understand
I'm turning them on myself with an EditorScenePostImportPlugin
if a light has a -shadow
suffix
from godot.
That might be a problem because blender doesn't export shadow state, it doesn't even seem to be a part of glTF from what I understand
Does the glTF specification even have a way to signal that certain lights should have shadows enabled? If not, it doesn't sound very usable for game development where you can't be "all or nothing" in real world projects 🙁
I suppose we could add support for a -shadow
import hint and/or offer an import option to set omni/spot shadow range thresholds (where all lights larger than a certain range have shadows enabled), but that's not great to hear.
from godot.
Does the glTF specification even have a way
I suppose we could add support for a -shadow import hint
I can't think of a reason not to
from godot.
Related Issues (20)
- TileMapLayers that are children of Control nodes have their rendering quadrants affected by physics interpolation even if TileMapLayer has physics interpolation turned off
- Audio/mic_record/MicRecord.gd is located under Android, and the recorded content is blank.
- Tilemap colliders have inconsisent behavior with move_and_slide() Max Angle (see pictures) HOT 8
- Automatic update checking leads to broken URL HOT 2
- Editor re-starts (specifically executing _enter_tree() on tools) scenes when reimporting anything HOT 3
- The match() method of the String type fails even on simple patterns HOT 2
- [4.3 beta1 mono], Android remote debug shows black sreen after splash screen if any C# script is attached to node. HOT 2
- External Editor Output sometimes combines two different print statements (Jetbrains Rider / C#) 4.3 beta 1 HOT 2
- Editor icon size are different on `macOS` (image 16px vs 32px) HOT 3
- Reload dialog has opposite effect for project settings HOT 1
- C# export is broken on 4.3.beta1 HOT 9
- Viewport DEBUG_DRAW_UNSHADED wrong rendering with metallic materials HOT 2
- Previously freed objects shown as `<null>` in the debugger HOT 1
- Scroll wrap in 2D editor sometimes doesn't work HOT 3
- Console application print_rich() BBCODE color problems in windows 10 HOT 1
- Copied resources aren't duplicated anymore HOT 7
- To enable Wayland, fctix5 can't switch input method HOT 1
- NOTIFICATION_SORT_CHILDREN is being called twice on start for all Containers.
- Huge .tscn Icon and icon in background of File System panel
- some operations in subresource of inspector will cause unexpected scroll behavior HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot.