DarkPlacesEngine / DarkPlaces

The DarkPlaces Quake engine, created by LadyHavoc. Official Git repository (replaces SVN).
https://icculus.org/twilight/darkplaces/
GNU General Public License v2.0
273 stars 39 forks source link

envmap broken - does not change look angles correctly #123

Open Baker7 opened 7 months ago

Baker7 commented 7 months ago

Tried "envmap", interested in making a cubemap to use in a shader.

DarkPlaces Beta is doing it like this (rotating the picture)

medn meft melf mert meup mebk

DarkPlaces Classic ... (reorients the view)

_bk _dn _ft _lf _rt _up

The code is not much changed in void R_Envmap_f and the view angles are set correctly into r_refdef.view.matrix, so something else is up.

Baker7 commented 7 months ago

I shouldn't "fix" it like this .. yet this fixes it ...

if 1

R_RenderView(0, NULL, NULL, r_refdef.view.x, r_refdef.view.y, r_refdef.view.width, r_refdef.view.height);

else

    R_RenderView(rt->fbo, rt->depthtexture, rt->colortexture[0], 0, 0, size, size);

endif

What I should do is see why the new code isn't working as intended.

I wanted to see what "reflections" would like if I use an environmental map shader using a cubemap actually made from the area (I kind of needed "envmap" and then throw them in https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html and use that in a shader

Resulting in something like this ...

zec_park_cube_env

If you want a mirrorish effect for virtually free, that works. Or environmental effects that use the actual area.

/Extra: "envmap" should write jpgs at least as an option