Aeva / m.grl

Midnight Graphics & Recreation Library
http://mgrl.midnightsisters.org
GNU Lesser General Public License v3.0
44 stars 3 forks source link

deferred lighting system renders nothing #244

Open Aeva opened 7 years ago

Aeva commented 7 years ago

This affects the fast_graph branch and relates to issue #232.

Nothing renders in the light demo, and this error is thrown in firefox developer edition: Error: WebGL: drawElements: Feedback loop detected between tex target 0x0de1, tex unit 2, levels 0-0; and framebuffer attachment 0x8ce1, level 0

This probably means that a render target is bound to a texture while trying to write to it.

Aeva commented 7 years ago

4bdb606cdd2285c33c07bfd873a2ca1f60d76161 adds a GL debugging mode that should hopefully make this a little easier to figure out.

Aeva commented 7 years ago

chrome produces no error, but also does not render anything.

Aeva commented 7 years ago

Resolved the feedback loop gl error, so, uh, now firefox behaves about the same as chrome in terms of telling me anything immediately useful =)

I guess the next thing to try is to step through a frame and see what happens.

Also, this is totally broken in master, too. Oopse.

Aeva commented 7 years ago

MRT seems to be working ok, at least in a simple case.

Aeva commented 7 years ago

Commit e119c910cc3f047aa91697bc25de99f428620374 provides another clue? MRT samplers sometimes render blank.

From the commit message: FloatingPointBufferViewer curiously works fine when used with PictureInPicture (even several nested ones), but not in DebugViewportSplitter. In the later case, they just render completely blank

Aeva commented 7 years ago

73986f46f79fce1b64413313e906b98787afb83d shows the lighting system partially working. Everything disappears after the loading screen transition effect, which is another bug that was fixed later on. Might be able to just bisect from there to find what changed.

This bug for this issue also seems to be present in master, which is surprising. Going back to really old commits in master's history seems to still have the "disappear after transition effect" problem o_O. These are commits that used to work fine. Firefox developer edition seems to be the problem for that (spits out GL warnings that I fixed later on). Chrome does ok with everything in master.

Git bisect tells me that 30a1360abb5b5eef18a2711aca72e805194c876a is where this broke.

Aeva commented 7 years ago

I'm not convinced the commit in the message above is actually useful for this problem. But, if it is, then it would be a good idea to review that uniforms relevant to flow control in the illumination shader are actually being set correctly.

I have another lead, though: chrome's debugger spams RENDER WARNING: there is no texture bound to the unit [1-3] over and over again with the debug build. It does not do this for the working compositing demo, interestingly. Firefox provides no error or warning.

Aeva commented 7 years ago

The shader currently fails to build with a error about redundant definition of the world_matrix uniform. This is probably occurred while adding in support for the instancing syntax, though I'm not actually sure.

Also not sure if this is a compiler bug, or if there is an inconsistency within the deferred renderer's shader source.