- Home /
No Realtime Lighting on Build in OpenGL
My realtime lighting is not working in my Windows build (haven't tested any others) unless I have the Unity Engine open while running the game application. I'm using OpenGLCore to render the game - the problem does not occur when I use DirectX. Why could this be happening and is there any way to fix it aside from using DirectX?
**While I may not have an issue anymore, I think this is still worth addressing in case anyone else runs into this problem that really needs to use OpenGL. I also assume I will have this issue again when I choose to export to Mac.
My (tangential but useful) fix for upside-down rendering when using DirectX: I was using OpenGL because one of my shaders was interacting with DirectX in such a way that it was rendered upside-down. I had trouble implementing the popular fix for this because of my unfamiliarity with Shader coding, so my way was to simply use OpenGL instead. This caused the above lighting problems, so the way I've since worked around it using DirectX is by using a RenderTexture on my main camera, and pointing an orthographic solid color Second Camera at a plane equipped with this RenderTexture (material w/ unlit shader) - that fixed my lighting issue and it also caused my image to no longer be flipped upside down.
Your answer
Follow this Question
Related Questions
Switch Precomputed Realtime GI data using scripts 0 Answers
Why is Depth different in OpenGL? 1 Answer
Why baked lightmap spotlights doesn't affect a game object when lights switched to realtime? 0 Answers
Realtime light goes through mesh (did research, not helping) 1 Answer
Number of light in URP and in Default, got some problem 2 Answers