cnlohr / noeuclid

Non-euclidean GPU Raytraced Game
BSD 3-Clause "New" or "Revised" License
644 stars 48 forks source link

Pass1/Physics shaders are separate. #16

Closed phiresky closed 9 years ago

phiresky commented 9 years ago

Is there a particular reason for this? The code is almost identical and already has a variable doPhysics in it, which is defined as false in Pass1.frag and varying in Pass1Physics.frag. Would be nice if they could be joined or seperated more.

phiresky commented 9 years ago

Diff: https://www.diffchecker.com/5nrbv7ou

cnlohr commented 9 years ago

We could use #define's to separate them out, however, I made the separate because the individual shader got too lengthy to run on the GPU. Additionally the functional output buffers have slightly different definitions.

That said, there are already a few errors I've noticed that have developed because I updated one and forgot to update the other.

tl;dr: I couldn't figure out a better way of doing it, so I opted for the terrible way.

phiresky commented 9 years ago

but #defines shouldn't have a runtime impact, right? I'll try to merge them and see if it works.

phiresky commented 9 years ago

I merged them and everything seems to work fine. I did not change any of the actual code so it can probably still be simplified.

cnlohr commented 9 years ago

Mind pushing your changes so I can review?

defines do not impede runtime performance.

phiresky commented 9 years ago

https://github.com/cnlohr/noeuclid/commit/4ba3bf8301c640ea9ca9747a7e06b60ca90931c0

cnlohr commented 9 years ago

Also from other thread: I was updating to the wrong branch. Everything still works. Impressive.