Commit Graph

87 Commits

Author SHA1 Message Date
Eric Wasylishen 30868eacb7
light: LIGHTING_E5BGR9 + HDR .lit support (#427)
* light: Add support for LIGHTING_E5BGR9.

This is not really finished. Currently mutually exclusive with
regular RGBLIGHTING, and not tested with external .lit file.

* light: replace HDR_PackResult with a version following the OpenGL spec

- add HDR_UnpackE5BRG9 for unpacking
- caller is now responsible for scaling 128 -> 1
- expose in header for tests

* light: move HDR_PackE5BRG9/HDR_UnpackE5BRG9 to common/litfile.hh

* build: std::powf not available in gcc

* common: move LoadLitFile to litfile.hh

* common: LoadLitFile: return hdr variant as well

* lightpreview: add an Exposure slider

* lightpreview: support hdr .lit's, wip

* tests: refactoring to set up testing for hdr lit's

* tests: add test for -hdr and -bspxhdr

* tests: fix LM_Sample to deal with styles correctly

* lightpreview: fix glsl error

* lightpreview: show dialog box for glsl compile errors

---------

Co-authored-by: Daniel Svensson <dsvensson@gmail.com>
2024-05-26 21:55:10 -06:00
Jonathan 6157945d4d optimize Q2 brush info by using world-aligned defaults if they exist
optimize Q2 animations by using world-aligned defaults, since Q2 only needs the secondary texinfo for the texture
2024-03-05 11:11:20 -05:00
Eric Wasylishen 1f02b50441 lightpreview: add "Camera Bookmarks" submenu 2024-02-25 23:35:50 -07:00
Eric Wasylishen b9c03d9d2e lightpreview: adjust drawflat colors 2024-02-19 22:28:47 -07:00
Eric Wasylishen 28d4fd3715 lightpreview: comment out some debug spam 2024-01-05 12:30:33 -07:00
Daniel Svensson e1ad344949
lightpreview: Frustum culling and cull freeze. (#398)
* lightpreview: Frustum culling and cull freeze.

* lightpreview: Remove unused desired vis tracking.
2024-01-05 12:08:21 -07:00
Daniel Svensson 04c3a5117a
lightpreview: Add support for fence textures. (#402) 2024-01-04 16:05:22 -07:00
Eric Wasylishen f47602050b lightpreview: disable "uploaded {} bytes face visibility texture" debug spam 2023-12-24 16:40:44 -07:00
Maik Merten c62633f1a3 lightpreview: Add arrow-keys and pageUp/pageDown-keys for navigation.
This is useful for keyboards where WASD isn't practical, e.g., AZERTY-layout (France).
2023-12-14 23:15:24 -07:00
Jonathan 1eaf2170f8 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp
# Conflicts:
#	light/trace_embree.cc
2023-12-07 14:13:36 -05:00
Jonathan 9ed4f3d042 bunch of double -> float
fix Q2 animated textures
2023-12-07 14:11:46 -05:00
Eric Wasylishen de0f66c16e lightpreview: fix vis culling with large .bsp's (use buffer textures rather than 1D textures)
disable VisualizeLeafs call as it has crashes that need to be investigated
2023-11-23 19:50:31 -07:00
Eric Wasylishen 7e5ad9a39b lightpreview: add support for Q1 visdata 2023-11-06 22:54:21 -07:00
Jonathan b83c4a6440 use fold expr instead of for statements in vec3
fix a bunch of clang warnings
2023-11-04 19:01:08 -04:00
Eric Wasylishen e84ba4cc68 lightpreview: leaf visualization: draw leaf outlines 2023-10-19 23:58:39 -06:00
Eric Wasylishen d6fbefaf0e lightpreview: decompile hulls for leaf visualization 2023-10-19 00:10:42 -06:00
Eric Wasylishen a109dfca28 lightpreview: add "show bmodels" checkbox 2023-09-30 15:18:14 -06:00
Eric Wasylishen 248ed7c614 lightpreview: render Q1 faces with missing textures 2023-09-30 11:41:34 -06:00
Josh Dowell 04044dd76d
lightpreview: fix texture mips not being generated (#385)
This was happening because allocateStorage allocates space for the texture and its mips up-front, the user of QOpenGLTexture is required
to determine the number of mips required for a texture beforehand.
allocateStorage was allocating space for mip 0 and no others, leading to no additional mips being generated.

This also adds explicit format and type to allocateStorage for only this instance, although it still remains optional.
2023-09-13 23:18:51 -06:00
Eric Wasylishen dedc524f6a lightpreview: add fixme 2023-09-11 19:35:20 -06:00
Eric Wasylishen 1924954758 build: fix clang-cl build 2023-09-04 00:42:00 -06:00
Eric Wasylishen b8132be96e lightpreview: fix crash on Q1 maps with missing textures 2023-08-30 23:08:36 -06:00
Eric Wasylishen 6c6bed2597 lightpreview: add "Draw Translucency as Opaque" checkbox 2023-08-27 14:58:08 -06:00
Eric Wasylishen 7608a78b44 style: use std::min/std::max/std::clamp and remove using 2023-08-07 15:42:29 -06:00
Eric Wasylishen 6b83f36b6f lightpreview: fix glsl syntax error 2023-08-05 20:21:02 -06:00
Eric Wasylishen 9f7ba65758 lightpreview: fix bmodel rendering when vis culling is in use 2023-07-30 12:21:54 -06:00
Eric Wasylishen 7b83aa5976 lightpreview: add vis culling checkbox 2023-07-30 11:26:59 -06:00
Eric Wasylishen edb664f200 lightpreview: preliminary vis culling
- q2 only
- not handling bmodels properly
2023-07-29 15:49:36 -06:00
Eric Wasylishen 07020ceeae lightpreview: add "Show Tris (See Through)" option 2023-07-29 15:49:36 -06:00
Eric Wasylishen 4994ab4f1d lightpreview: format code 2023-07-29 15:49:36 -06:00
Jonathan aa70d6dc00 draw lines and portals
disable leakdist by default
2023-07-09 15:44:23 -04:00
Eric Wasylishen fbea58d679 code formatting pass 2023-06-25 18:29:48 -06:00
Jonathan 15f0f97fb3 remove __debugbreak 2023-06-19 15:38:44 -04:00
Jonathan da2e6936d1 allow toggling BSPX loading 2023-06-16 03:40:04 -04:00
Eric Wasylishen 35fa5bd129 lightpreview: add "Nearest filter" checkbox 2023-06-11 23:20:07 -06:00
Jonathan 4500b164b6 proper skybox rotations 2023-06-08 23:11:37 -04:00
Jonathan cd27dae7e1 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-06-08 22:23:16 -04:00
Eric Wasylishen b626d9447f lightpreview: wip fixing skybox rendering 2023-06-08 20:22:29 -06:00
Jonathan 0663707fe3 Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-06-08 22:18:37 -04:00
Jonathan 9d3b0f9878 alpha test 2023-06-08 22:18:32 -04:00
Eric Wasylishen 89e714a077 lightpreview: don't render frames when not interacting 2023-06-06 23:30:50 -06:00
Eric Wasylishen 062c458913 lightpreview: use a placeholder texture for missing textures 2023-06-06 20:58:05 -06:00
Jonathan c3461a107b Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp 2023-05-29 04:38:08 -04:00
Jonathan 6c2b4f6f04 sky rendering (still needs work)
wireframe slightly easier to work with
2023-05-29 04:37:23 -04:00
Eric Wasylishen 3e51f2aeaa lightpreview: report camera position to main window 2023-05-28 00:27:52 -06:00
Eric Wasylishen 442237de02 lightpreview: also use QCursor::pos() in case it helps reduce stuttering 2023-05-25 20:46:17 -06:00
Eric Wasylishen a35c8abe74 lightpreview: fix jerky camera movement + flying issue 2023-05-25 20:27:25 -06:00
Jonathan 2a7bb05cee lightstyle init fixes 2023-05-24 21:58:08 -04:00
Jonathan 18a5b37d4f lightstyle stuff 2023-05-24 21:48:39 -04:00
Eric Wasylishen 901e87bce8 lightpreview: prompt for screenshot path 2023-05-24 00:55:31 -06:00