jmickle66666666 / DoomUnity

Unity libs for working with Doom, also my Doom engine: NaSTY
88 stars 7 forks source link

Updated shaders. #35

Closed Petethegoat closed 6 years ago

Petethegoat commented 6 years ago

Main changes are moving everything back to the opaque geo queue/render type, removing the blending too.

The sky is mostly unchanged, but is now flipped correctly.

texture.shader now works for me again and looks very roughly equivalent to chocolate doom, and I haven't noticed the weird problem from before. Let me know if you have any issues and I'll get back to working on the sky shader.

Petethegoat commented 6 years ago

Also it'd be useful to know what camera settings you're using! Just an inspector screenshot or something would be great.

jmickle66666666 commented 6 years ago
screenshot 2017-12-31 13 58 56
jmickle66666666 commented 6 years ago

depth appears to have very little impact on my machine, and is also reversed. I'll need to do some scaling to get it in a range that makes any noticeable difference

jmickle66666666 commented 6 years ago

i've been testing the depth impact by swapping col out at the last line with float4(dscale,dscale,dscale,1.0) or float4(depth,depth,depth,1.0) btw.

Petethegoat commented 6 years ago

yeah, I was doing that too- I see you're using deferred rendering, and I suspect that might be the key difference between our setups, as I think my project is still in forward.

edit: it's not :(

jmickle66666666 commented 6 years ago

Ah, I'll change that back and see if it changes things. There wasn't any thought behind using deferred, I was probably just experimenting at some point.

Petethegoat commented 6 years ago

Here's DOOM2.WAD MAP01 with depth only (return float4(depth,0,0,1); ) depth

I can't detect any difference between rendering paths on my machine, but adjusting the near clip plane makes a big difference, and I had it at the default 0.3- I didn't notice as I was adjusting the far clip plane most of the time, which has negligible impact.

jmickle66666666 commented 6 years ago

yeah so the scale is actually pretty small, i'm using a scale of 1 doom unit as 1/64 in unity. (A doom unit is a pixel on a texture), which means the near plane is important when you're pressed against corners. far plane is very insignificant.

screenshot 2017-12-31 18 09 02 (this is how it looks for me)

I'm gonna take some reference shots to compare against

Petethegoat commented 6 years ago

Sounds good. I'll follow your camera settings from now on, so let me know if you change anything. Wonder if it's worth loading the key camera settings from json or something, so it's easier to version control.

jmickle66666666 commented 6 years ago

I'm gonna just throw the player controller in the github at some point, just need to clear out the stuff i don't need

jmickle66666666 commented 6 years ago

screenshot_doom_20171231_181155 ^ probably something like what we should be seeing (taken from gzdoom's opengl renderer, using a flat light level and all-white textures)

screenshot_doom_20171231_181812 ^ after clamping to the (16!) indexes doom actually uses for light levels. (I'm using the full 32 and i think thats incorrect) (i think thats clamped to 16? not 100% certain) (taken from gzdoom's software renderer, using a flat light level and all-white textures)