1
0
forked from 0ad/0ad
Commit Graph

68 Commits

Author SHA1 Message Date
b1b96a89d6 Fix culling for shadows and reflections.
Previously we had a single culling frustum based on the main camera, and
any object outside the frustum would never get rendered, even if it
should actually contribute to shadows or reflections/refractions. This
caused ugly pop-in effects in the shadows and reflections while
scrolling.

Extend the renderer to support multiple cull groups, each with a
separate frustum and with separate lists of submitted objects, so that
shadows and reflections will render the correctly culled sets of
objects.

Update the shadow map generation to compute the (hopefully) correct
bounds and matrices for this new scheme.

Include terrain patches in the shadow bounds, so hills can cast shadows
correctly.

Remove the code that tried to render objects slightly outside the camera
frustum in order to reduce the pop-in effect, since that was a
workaround for the lack of a proper fix.

Remove the model/patch filtering code, which was used to cull objects
that were in the normal camera frustum but should be excluded from
reflections/refractions, since that's redundant now too.

Inline DistanceToPlane to save a few hundred usecs per frame inside
CCmpUnitRenderer::RenderSubmit.

Fixes #504, #579.

This was SVN commit r15445.
2014-06-25 01:11:10 +00:00
833c2bac7a save/restore camera position and orientation in saved games, fixes #2354
This was SVN commit r14905.
2014-04-06 16:27:57 +00:00
e9e05f4efc Second (main) commit for the SpiderMonkey upgrade.
This commit contains all the required changes to our source files and
build scripts (hopefully).
A next commit will remove the old stuff of SpiderMonkey 1.8.5.

Spcial thanks to:
 - H4writer who helped a lot mainly with the performance issues we
had/have, but also with other problems or questions.
 - Leper for the review.
 - Historic_bruno for implementing the build scripts on Mac OS X and
testing on the Mac.
 - The people from the #jsapi channel and from
mozilla.dev.tech.js-engine who answered a lot of questions and helped
solving problems.
 - All the other people who helped

Refs #1886
Fixes #2442
Fixes #2416

This was SVN commit r14877.
2014-03-28 20:26:32 +00:00
5304bc9d6a Changes GameView to expose global functions to scripts instead of using CJSObject.
Fixes #2126
Refs #1886

This was SVN commit r13826.
2013-09-12 12:40:05 +00:00
6f3a0e1378 Implement location hotkeys. Fix #1882.
This was SVN commit r13463.
2013-06-09 20:21:19 +00:00
vts
6b50a660b9 Added elapsed real time (as opposed to elapsed simulation time) to MT_Interpolate messages. Fixes leftover TODO from #824. Refs #824.
This was SVN commit r11944.
2012-06-06 19:37:03 +00:00
769350a3e7 Compute camera height and zoom limits based on smoothed terrain heightmap. Fixes #794, based on patch by Dietger.
This was SVN commit r11556.
2012-04-18 20:39:00 +00:00
vts
db864f10c3 Rendering marker lines between buildings and rally points
Added command button to focus on rally point
(implements #524)

This was SVN commit r10704.
2011-12-10 07:07:04 +00:00
39d100c732 Moves camera projection settings to default.cfg.
Changes field of view (FOV) to 45 degrees per discussion. Fixes #941.
Tweaks default camera zoom and rotation accordingly.

This was SVN commit r10548.
2011-11-17 23:34:01 +00:00
f9d7c1246d # Initial support for territories
This was SVN commit r9889.
2011-07-20 19:48:06 +00:00
1bc2db56ea Stops unit following when other object selected. Fixes #775
This was SVN commit r9764.
2011-07-05 21:29:11 +00:00
2fd4c62cbb Remove some unused variable declarations
This was SVN commit r9174.
2011-04-06 00:04:35 +00:00
29dd635d3b Fix decals and LOS texture in Actor Viewer, by slightly reducing use of globals.
Fix particles in Actor Viewer.
Expand terrain in Actor Viewer.
Change background to black so it blends with the LOS texture more
nicely.

This was SVN commit r9172.
2011-04-05 20:32:03 +00:00
d295dacb9b # Add new renderer mode based on GL_ARB_fragment_program.
Change lighting model for new maps to allow better overbrightness.
Cache player colours instead of loading from scripts every time the
renderer wants them.

This was SVN commit r9123.
2011-03-26 20:17:21 +00:00
3a5ca7fdbc Improve camera restraints at edge of map to be independent of zoom, and to work on circular maps.
Fixes #573.

This was SVN commit r9011.
2011-03-04 20:02:05 +00:00
fe21c5e023 # Rewrite fog-of-war rendering.
Disable shadows when only 2 TMUs available.
Clean up some other rendering code.

This was SVN commit r8882.
2011-02-03 01:12:24 +00:00
47246c8155 Fixes #572. Changed MoveCameraToTarget so that for minimap scrolling it will ignore changes in Y position, to maintain previous zoom level as expected (constraint keeps the new view from being inappropriate)
This was SVN commit r8676.
2010-11-21 04:59:59 +00:00
540925aa32 Add a rubbish experimental FPS camera view
This was SVN commit r8520.
2010-11-01 21:40:29 +00:00
82691683cb Fix #56 (add unit-following camera mode (press 'F')), based on patch from markelov.
Remove obsolete IsNewSimulation function.

This was SVN commit r8190.
2010-09-26 23:05:25 +00:00
0fa0181f0c Fix #554 (camera should be always inside the terrain), based on patch from markelov
This was SVN commit r8070.
2010-09-04 12:50:27 +00:00
f221caecda Add camera angle/zoom reset key ("H")
This was SVN commit r7941.
2010-08-14 00:52:19 +00:00
6c7b82130c # Redesigned the camera control system.
Add shift+wheel (and Q/E, and ctrl+arrows, and ctrl+WASD) to rotate the
camera.
Restrict the rotation and zoom to narrow ranges. (Constraints can be
disabled in the dev overlay).
Smooth the movement and rotation.
Fix some stupid whitespace.
Fix some const correctness.

This was SVN commit r7930.
2010-08-13 13:26:29 +00:00
1c0536bf08 # Refactored the networking code, and redesigned the game setup screen.
Major updates to most network classes.
Simplify CNetServer so it doesn't duplicate any client behaviour; all
players now run CNetClient.
Remove most player/slot management from networking code.
Wait for all players to finish loading before starting the simulation.
Remove CGameAttributes; attributes are now just a JS object.
Remove CPlayer; they are now just simulation entities.
Handle player colours via simulation system.
Add a default map for Atlas, so it always has something to load.
Move network documentation to Doxygen.
Remove lots of now-unused code.

This was SVN commit r7653.
2010-06-30 21:41:04 +00:00
0f611042b1 # Support alt+enter to toggle fullscreen mode. Make game window resizable.
Refactor the video mode setting logic to cope better with dynamic
changes.

This was SVN commit r7606.
2010-06-03 19:07:59 +00:00
1fc75e7605 Expand the culling frustum to reduce shadow popping (see #504). Based on patch from Zoomastigophora.
This was SVN commit r7562.
2010-05-21 18:31:47 +00:00
56bb858802 # Delete a lot of obsolete simulation code.
This was SVN commit r7555.
2010-05-20 18:09:23 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
b51353ae0b Use NONCOPYABLE macro, to avoid ICC warnings
This was SVN commit r6589.
2009-01-03 18:40:28 +00:00
5228800b73 # Fixed Linux build
Use noncopyable instead of boost::noncopyable. (But maybe this should be
changed to the NONCOPYABLE macro instead?)
Use boost::filesystem::wpath::file_string instead of
external_file_string, since the latter varies between std::string on
Linux and std::wstring on Windows.
Use wcstombs instead of wcstombs_s.
Use rtl_AllocateAligned instead of _mm_malloc.

This was SVN commit r6574.
2009-01-02 21:19:41 +00:00
af6694262a cleanup:
remove ONCE(ScriptingInit) constructs, replace with direct call from
GameSetup
revised GameSetup's InitScripting (organize into groups)
JSCollection: remove #define of two concrete collection types (made
typedef, moved to their respective entity.h and player.h)

This was SVN commit r5871.
2008-04-06 14:03:23 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
8d0a7170f6 # Slightly tidied up string code.
CStr: Indented comments more consistently. Made some parameters
pass-by-reference, made some others not. Removed some useless methods -
Length (use length or empty), GetSubstring (use substr), LCase/UCase
(use LowerCase/UpperCase). Removed operator[] bounds-checking because
VS2005 does that anyway.
Maybe fixed noncopyable warnings on VS2003.

This was SVN commit r4828.
2007-02-01 14:46:14 +00:00
f5bcb031ff Fix for GCC
This was SVN commit r4764.
2007-01-13 18:32:03 +00:00
ec69bccb2c # Tidied up some code.
- Made some classes not be singletons, since there's no reason why they
should be.
 - Made them non-global too (because globals have unclear lifetimes, and
make it harder to test things, etc). They're now owned by CGameView and
CWorld, and mostly accessed via g_Game or arguments (vaguely trying to
avoid the graphics code calling into the game code).
 - Moved CGameView implementation into pimpl, so the header file isn't
so heavy.
 - Changed a few pointers into references, to indicate that they're
never NULL.

This was SVN commit r4756.
2007-01-08 01:56:46 +00:00
c14765989e # Introduce a Scene abstraction that allows the renderer to query visibility from multiple virtual camera positions.
This is the first step towards fixing #142

This was SVN commit r4385.
2006-09-24 11:25:11 +00:00
a63f49e582 Add gameView.culling and renderer.skipSubmit for debugging purposes.
This was SVN commit r4382.
2006-09-23 16:04:54 +00:00
35e91718c5 # Added tool for viewing models and animations outside the game.
Atlas: Added ActorViewer. Moved GL canvas into separate class for shared
use. Disabled message-handling callback while blocked on the game, and
stopped creating dialog boxes inside the game thread in order to avoid
deadlocks (hopefully). Support multiple Views (for independent sets of
camera/update/render code). Recalculate territory boundaries when
necessary. Changed default list of animations to match those currently
used by actors.
# Tidied up more code.
Moved some more #includes out of .h files, to minimise unnecessary
compilation.
MathUtil: Deleted unused/unuseful macros (M_PI (use PI instead), M_PI_2
(use PI/2), MAX3, ABS (use abs)).
ObjectManager: Removed some ScEd-specific things.
Unit: Moved creation out of UnitManager, so units can be created without
adding to the manager. Changed CStr8 to the more conventional CStr.
app_hooks: Removed warning for setting multiple times.
win: Restored SEH catcher.
GameSetup, GameView: Removed RenderNoCull, because it doesn't seem to do
what it says it does ("force renderer to load everything") since we're
loading-on-demand most stuff and it doesn't seem especially useful since
we'd prefer to minimise loading times (but feel free to correct me if
I'm wrong). (And because it crashes when things need to be initialised
in a different order, so it's easier to remove than to understand and
fix it.)
PatchRData, Renderer: Work sensibly when there's no game (hence no LOS
manager, water, etc).
LOSManager: Use entity position instead of actor position when possible.
TerritoryManager: Allow delayed recalculations (so Atlas can issue lots
of move+recalculate commands per frame).
Cinematic: Non-pointer wxTimer, so it doesn't leak and doesn't have to
be deleted manually.

This was SVN commit r4261.
2006-08-28 17:36:42 +00:00
bc24974496 # sweng
forward declare SDL_event. remove SDL dependency of network code.
refs #140

This was SVN commit r4252.
2006-08-26 21:52:18 +00:00
pyrolink
a95c72d0c1 Upgraded console (text wrap, help text), cinematic stuff
This was SVN commit r4065.
2006-07-06 03:17:44 +00:00
a553182f6a More header-file rejigging.
This was SVN commit r3993.
2006-06-09 18:32:00 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
f45c44ca09 Rotated various things (terrain texture UVs, default light and camera angles) by 45 degrees.
Map XML: Store camera position. Stopped using DTDs (because they make it
too hard to change the XML structure without breaking all the old XML
files).
Game.h: Include fewer files, to make compilation sometimes faster.
World: Changed some things to not be singletons, since they were
(ab)used as CWorld members.

This was SVN commit r3670.
2006-03-21 20:55:45 +00:00
36fa5ec2bf * clean up CLightEnv a bit
* add CLightEnv::m_TerrainShadowTransparency
* shadows will let a fraction of diffuse light through
* added JS LightEnv objects, so the lighting environment can be changed
  from the console
* new element TerrainShadowTransparency supported in the scenario .xml
format,
  changed cantabrian_generated with an example

This was SVN commit r3513.
2006-02-15 00:45:16 +00:00
pyrolink
20c8dd4e37 Test track queue thing
This was SVN commit r3476.
2006-02-05 02:51:02 +00:00
pyrolink
6af039def8 -CinemaTrack-refined
GameView- commented out test track in constructor, and commented out
hotkey interface
NUSpline-added bounds checking and corrections
Hotkey-added cinematic hotkey (doesn't work though (see above) )

This was SVN commit r3442.
2006-01-29 23:25:04 +00:00
f25de48559 - Seperate ViewCamera (eye position) and CullCamera (model culling, shadow
calculations) internally. Use ?gameView.lockCullCamera = true in the
console
  to move around while the CullCamera stays in place
- add CCamera::Render to visualize a camera's frustum
- use ?renderer.debugFrustum = true in the console to visualize the
frustum
  of the CullCamera

This was SVN commit r3405.
2006-01-22 19:12:30 +00:00
a5d1968a8c ProfileViewer: Fixed char* vs wchar_t*.
Quaternion: Removed operator- since it doesn't seem geometrically
sensible for rotation-quaternions. Added ToAxisAngle but don't actually
use it anywhere.
GameView: Changed unit-view to look slightly more correct.

This was SVN commit r3201.
2005-12-06 20:16:50 +00:00
pyrolink
300ff4578b Added camera enhancements and cinematic suppport
This was SVN commit r3199.
2005-12-06 06:58:30 +00:00
74bf76d523 fix bug #71 - was a double-free (both ~CRenderer and UnloadResources were calling UnloadWaterTextures)
This was SVN commit r3071.
2005-10-31 18:57:03 +00:00