Commit graph

112 commits

Author SHA1 Message Date
Zack Middleton
fdc08e860e Improve IQM loading
- Only allocate memory for vertex arrays that are present in the IQM
file and are actually used (may not have colors or blend index/weights,
don't load tangents in opengl1). (Colors is fixed to next commit.)
- Explicitly handle loading IQM files without meshes (bones only).
- Better IQM validation. Header data offset 0 mean data is not present
in file. Check if required vertex arrays are present.

This involved a lot of white space changes and moving code around.
2018-07-27 17:40:16 -05:00
Zack Middleton
14cc4cc6cb OpenGL2: Fix world VAO cache drawing when glIndex_t is unsigned short
OpenGL ES is only required to support unsigned short for element buffer
values.

R_DrawElements() firstIndex argument was glIndex_t which caused element
indexes to wrap around to 0 when glIndex_t is an unsigned short.
(glIndex_t is an index into the vertexes buffer, not element buffer.)
Change it to 'int' like tess.firstIndex which is passed to
R_DrawElements().

World VAO cache buffer size allowed storing more vertexes than unsigned
short glIndex_t could reference. This resulted in the vertex indexes in
the element buffer wrapping around to 0.
2018-07-20 23:40:31 -05:00
Zack Middleton
d861a4f427 Load OpenGL ES 2.0 function procs
Load functions procs supported by OpenGL ES 2.0, though there is not a
compatible renderer yet. Change argument for GLimp_Init from coreContext
to fixedFunction.
2018-07-20 23:40:21 -05:00
Zack Middleton
7391215bd4 Don't load non-core GL functions for OpenGL 3.2 core context
Also declare the GL functions in tr_local.h so there is compile error
for non-core GL functions instead of SEGFAULT from dereferencing a NULL
pointer.

Disable the non-functional stencil shadow code that hasn't been updated
to use OpenGL 3.2 core compatible drawing.
2018-07-20 23:40:17 -05:00
SmileTheory
c0c45d325d OpenGL2: Readd r_deluxeSpecular.
https://github.com/ioquake/ioq3/issues/369
2018-05-14 18:30:59 -07:00
Edward Betts
fe42b8653d Correct spelling mistakes. 2017-11-22 01:40:20 -06:00
Zack Middleton
c9d12aa3f3 Add common OpenGL version parsing + OpenGL 3 fixes
- Parse OpenGL version in sdl_glimp.c to share with both renderers.
- Add GL_VERSION_ATLEAST(major, minor) macro.
- Get address of glGetStringi if using OpenGL 3.
- Fix glConfig.extensions_string when using GL3 core context in
opengl2 renderer.
- Make opengl1 renderer's gfxinfo support qglGetStringi too.
2017-10-01 23:09:20 -05:00
Zack Middleton
59b1262b82 Fix floating point precision loss in renderer [part 2]
Fix floatTime using float precision instead of double using GCC.
Fix R_BindAnimatedImage to be in sync with function table.
Fix vertexDeform bulge, vertexDeform normals, noise wave function
at high level time.

Revert unnecessary float -> double conversions.
2017-08-03 00:14:22 -05:00
Zack Middleton
30fdd88c9f Fix floating point precision loss in renderer [part 1]
Patch for https://bugzilla.icculus.org/show_bug.cgi?id=5931 by
Eugene C. from 2013 plus recent fix for tcMod rotate.

I merged the changes into the OpenGL2 renderer though the fix for
tcMod turb doesn't translate.
2017-08-02 23:44:44 -05:00
SmileTheory
d549b642bc OpenGL2: Use an OpenGL 3.2 core context if available. 2017-07-13 12:03:10 -07:00
Zack Middleton
904bbc1a8f Allow more than 32 surfaces in skin files
Models don't have a surface limit; skins shouldn't either. Some player
models require more than 32 surfaces since vanilla Quake 3 did not
enforce the limit.

Skins are now limited to 256 surfaces because having no limit would
require parsing the skin file twice. The skin surfaces are dynamically
allocated so it doesn't increase memory usage when less surfaces
are used.
2017-07-04 14:06:09 -05:00
Zack Middleton
5aa7fb39c2 OpenGL2: Remove two unused cvars and update readme 2017-07-02 16:47:55 -05:00
SmileTheory
e03cdf444c OpenGL2: Remove SF_VAO_MESH. 2017-06-16 16:52:53 -07:00
SmileTheory
c65d2c2657 Add vao cache for static surfaces.
Remove support for draw range elements, multi draw arrays, world vao creation, surface merging.
2017-04-28 02:13:25 -07:00
SmileTheory
0672905ef1 OpenGL2: Detect Intel graphics and avoid/use certain operations there.
Also use qglCopyTextureSubImage2DEXT instead of qglCopyTextureImage2DEXT.
2016-12-07 22:30:55 -08:00
SmileTheory
2349ef038e OpenGL2: Don't interleave texCoords and lightCoords in tess. 2016-11-25 01:17:46 -08:00
SmileTheory
ba59df8c8c OpenGL2: Remove check for GL_ARB_texture_non_power_of_two.
Core in OpenGL 2.0.
2016-10-21 16:58:42 -07:00
SmileTheory
41ae7815c9 OpenGL2: Remove half float support.
Not enough accuracy for textures larger than 1024x1024, such as merged lightmaps.
2016-10-20 20:09:12 -07:00
SmileTheory
aa79738c50 OpenGL2: Store vertex colors and hdr lightmaps/lightgrid as RGBA16. 2016-10-11 03:28:20 -07:00
SmileTheory
239f539702 OpenGL2: Non-square merged lightmaps. 2016-10-10 03:06:03 -07:00
SmileTheory
8749d62bbd OpenGL2: Remove per fragment tangent space calculation code. 2016-09-14 03:57:51 -07:00
SmileTheory
4faf1008a0 OpenGL2: Remove map color scaling and r_forceSunMapLightScale.
Also simplify overbright code in ComputeShaderColors().
2016-09-14 02:59:54 -07:00
SmileTheory
927c9cc23c OpenGL2: Make R_FreeSurfaceGridMeshData() static. 2016-09-07 14:59:19 -07:00
SmileTheory
dfbaf50324 OpenGL2: Store normals/tangents as int16_t[4]. 2016-09-06 00:57:15 -07:00
SmileTheory
fe8ac838e2 OpenGL2: Preallocate grid surfaces like other BSP surfaces. 2016-08-14 22:22:20 -07:00
SmileTheory
716438168f OpenGL2: Use loader for all extension funcs. 2016-07-26 00:41:31 -07:00
SmileTheory
251c983681 OpenGL2: Require OpenGL 2.0. 2016-07-24 21:29:13 -07:00
SmileTheory
1f6703821f OpenGL2: Some FBO cleanup, and add non-depth blur to blur shader. 2016-04-05 02:37:05 -07:00
SmileTheory
5738d09969 OpenGL2: Add r_glossType. 2016-03-07 03:30:16 -08:00
SmileTheory
90d6f941f8 OpenGL2: Add r_shadowBlur. 2016-03-07 02:27:03 -08:00
SmileTheory
871872689e OpenGL2: Add named cubemaps and per-map env.json parsing. 2016-02-10 16:25:32 -08:00
SmileTheory
ad952b9537 OpenGL2: Merge several cvars into r_pbr.
r_glossIsRoughness, r_specularIsMetallic, r_framebufferGamma, r_tonemapGamma, r_materialGamma, r_lightGamma
2016-02-01 21:37:23 -08:00
SmileTheory
f70e9dac01 OpenGL2: Direct state access, part 2: Uniforms. 2016-01-18 23:30:36 -08:00
SmileTheory
275317fefb OpenGL2: Direct state access, part 1: Texture binds 2016-01-18 04:46:01 -08:00
SmileTheory
e2b2437966 OpenGL2: Add r_cubemapSize. 2015-12-24 16:34:58 -08:00
SmileTheory
c3216f54d2 OpenGL2: Replace r_exportCubemaps cvar with exportCubemaps command. 2015-12-23 09:58:11 -08:00
SmileTheory
a6a6162f04 OpenGL2: Add r_exportCubemaps for saving cubemaps on map load. 2015-12-22 05:04:07 -08:00
SmileTheory
cbfc3471bc OpenGL2: Switch to RGTC from LATC for normal maps.
Also added a RGTC compressor as a workaround on Intel graphics.
2015-12-15 03:23:55 -08:00
SmileTheory
f9c72eee69 OpenGL2: Parse radius entries from misc_cubemap entities. 2015-12-09 02:00:40 -08:00
SmileTheory
b52ede0445 OpenGL2: Add r_glossIsRoughness. 2015-12-08 21:23:50 -08:00
SmileTheory
92d4b20129 OpenGL2: Add option in code for alternate overbright method. 2015-12-08 05:17:05 -08:00
SmileTheory
e5aabdaff6 OpenGL2: Remove some rendering options for simplicity. 2015-12-03 02:44:33 -08:00
Zack Middleton
f110f668bf Move image load function prototypes to tr_common.h
The functions themselves are in code/renderercommon/tr_image_*.c
2015-06-12 14:22:37 -05:00
Zack Middleton
60d28722ef Remove unfinished OpenGL display list code
It seems unlikely anyone is going to do anything with this aside from stub
it out in OpenGLES ports.
2014-11-16 14:57:13 -06:00
SmileTheory
b1821e303d OpenGL2: remove lightmap support from generic glsl shader.
This path was barely used and doing this compiles fewer shaders.
2014-11-10 21:59:37 -08:00
SmileTheory
943259f6b4 OpenGL2: Support half floats for texcoords and vertex colors. 2014-11-03 19:10:35 -08:00
SmileTheory
3765652778 OpenGL2: Fix corrupt models. 2014-10-23 16:51:10 -07:00
SmileTheory
4f5ebf8349 OpenGL2: Bit of multidraw optimization. 2014-10-16 00:32:20 -07:00
SmileTheory
541d3a40c2 OpenGL2: Interleave vertex data for static MD3s. 2014-10-15 03:42:29 -07:00
SmileTheory
0578b70f38 OpenGL2: Reduce redundant GL calls. 2014-10-14 06:15:06 -07:00