Although this doesn't look as good as the PCF version it is a lot less calculation intensive and therefore more suitable for weaker hardware.
It also tends to bleed through walls a lot less.
(refactored patch by Graf)
Legacy used some strange blending formula to calculate its colormaps for colored 3D floor lighting, this is not available in the software lighting mode, so for these the engine has to temporarily revert to light mode 2 to render them correctly.
# Conflicts:
# src/gl/compatibility/gl_20.cpp
# src/gl/renderer/gl_lightdata.cpp
# src/gl/renderer/gl_renderstate.h
# src/gl/scene/gl_sprite.cpp
# src/hwrenderer/scene/hw_weapon.cpp
# src/hwrenderer/utility/hw_lighting.cpp
# src/hwrenderer/utility/hw_lighting.h
# src/v_2ddrawer.cpp
These were caused by some bogus comment in the original compatibility.txt which erroneously added a "SPAC_PCross" remark to a line which actually set "SPAC_Cross".
Pass surf->vbStart to SetupFrame instead of 0, and pass 0 to DrawArrays instead of surf->vbStart.
Use a potentially faster method of modifying the OBJ file text buffer by modifying it directly.
Add RealignVector and FixUV methods to begin work on re-aligning OBJ models to the same orientation as MD3 models.
Re-align OBJ models to match MD3 models
Fix normal calculation for re-aligned OBJs
Ensure AddSkins does not go out of bounds of surfaceskinIDs
Do not precache skins that were replaced by the user.
Fix OBJs with a large number of materials not being fully rendered
Print a warning message if a material referenced by the OBJ could not be found.
Free surface triangles once they are no longer needed
Also, use continue instead of return so that surfaces after those with missing materials are still rendered.
Fail if a face side has no vertex reference. Vertex references are required for a valid OBJ.
Clean up OBJ model code
Remove commented code, mainly Printf's that aren't used any more.
Add more documentation comments, and tweak existing documentation comments
Replace ParseVector2 and ParseVector3 with a template ParseVector function
Create a new surface for each 'usemtl' statement in the OBJ file, and fix memory errors caused by TriangulateQuad.
Calculate missing normals, and fix incorrect UV coordinates
Fix construction of vertex buffer for objects with multiple surfaces
Localize curMtl, curSurface, aggSurfFaceCount, and curSurfFaceCount to FOBJModel::Load(), since they are not used anywhere else.
Fix parsing of OBJs without UV references
Internally, I replaced hashtag line comments with C-style line comments, and I replaced each forward slash with newSideSep.
If no UV coordinates are available, add a default vector of (0,0).
Also, remove "this->" from ResolveIndex to make the code a bit cleaner, and fix a minor garbage issue I failed to notice earlier (normref would pick up garbage if there was no normal reference).
Ensure usemtl statements remain intact
It may be a bit inefficient, but I tried modifying the buffer directly, and I got memory corruption errors. In this case, it's a lot better to be safe than sorry.
What works:
- Parsing the model
- Constructing geometry (surfaces) for triangulated models
What doesn't:
- Rendering the model
- Building the vertex buffer
- Triangulating quads
RIndexOf returns the index where the substring starts, instead of the index where the substring ends - 1.
Deprecate the LastIndexOf method of StringStruct