I think you’re hitting a problem with the way godot does dynamic lights. Spotlights are indeed more costly than omni. At this point maybe you should go -even faker- and instead of having lights in the scene, bake the illumination to the wall’s texture and tint it with the color from the video. Ye olde vidyagame style!
Yeah, that might be a solution but I’ll have to think about that: faking three colour contributions on baked textures doesn’t seem the easiest – I can’t bake to an animated texture because the three videos I’m playing in a loop are different lengths so the colour contributions change all the time. I might investigate omni light culling first, if I can figure out how it works…
you can have three textures/color inputs in the same surface as long as your shader is made for that
Ok, that makes sense. I’ll have to write my own shader.
Now I can’t figure out how to bake the textures, though…
Use a GI probe or bake them in blender. Either way works.
I’d rather stay in Godot if I can, but I couldn’t find a way of baking lightmaps to textures…
I don’t see how spotlights without shadows are more expensive than omni lights.
Also, when shadows are enabled, spot lights are much cheaper than omni lights, as spot lights only need a single texture while omni lights need a cubemap (or dual paraboloid if you opt for that mode).
See Using Lightmap global illumination in the documentation. Note that rendering lightmaps when using OpenGL isn’t supported yet, but it will be in 4.3 (you can try 4.3.dev2 already). Baking lightmaps also can’t be done while the editor is running with Compatibility yet (this will be supported in 4.3). Therefore, in 4.3.dev2, you’ll need to bake lightmaps while using Forward+ in the editor, then switch to Compatibility before running the project.
For best performance, switch all light nodes to the Static bake mode and hide the light nodes. This way, lights won’t be rendered in real-time at all (not even on dynamic objects), but the lightmapper will still take the lights into account.
Sounds good to me. My question at this point is how to tint each light’s contribution as Efi was suggesting a few messages above. Remember I have three video screens and their average colour changes over time.
To clarify, I’m definitely using shadows with both spotlights and omnis but this doesn’t seem to impact performance very much with omnis (nor with spotlights to be fair, so maybe this is a non issue in my case)
Hardware video support is hard It may be possible in the latest versions of godot…
The solution would first have to link against whatever decoder libraries are present on the device to get hardware decoding, (instead of ffmpeg, unless ffmpeg does this already)
Then it would have to take the YUV frames and push them directly into godot textures RenderingServer.texture_rd_create()
can do this as of Godot 4.2 beta 1 (GH-79288) (currently video addons convert to RGB in software)
Then you’d need a shader to convert YUV frames to RGB on screen.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.