Small refactoring, optimization and documentation.
- when the dust cloud is rendered, the common uniforms are only set once
- game notifies about shader compiling/linking errors
- added some comments and made small code improvements
- matrices are corrected every 5 seconds instead of 10
Initial (rudimentary) support for shadow-mapping added.
- added framebuffer support to gl.js
- added support for binding more than 4 textures to gl.js
- shader for shadow map creation added
- ship shader now takes shadow mapping into account
- scenes can be created with shadow mapping support, needed methods and fields added to Scene class
- shadow mapping can be turned on-off in graphics menu
Added triangle indexing, multi-level shadow mapping.
- triangles are loaded with an index attribute to the vertex buffers, which can be used to match them with triangles rendered on the shadow map
- multiple passes of shadow mapping can be added with subsequently larger ranges
Improved shadow mapping, added settings for it in the menu.
- changed maximum levels of shadow mapping: 6, directional lights: 2
- the depth of shadow maps can be scaled
- light directions (matrices) corrected
- shadow mapping settings are stored in XML and HTML5 storage
- shadow mapping settings can be modified from the menu
Further improvements on shadow mapping, shadows in the database screen.
- texture, cubemap and vertex attribute binding fixed to prevent incorrect texture/attribute access
- shader for shadowed database screen display added
- added comments to shadow mapping in shader code
- shadow mapping now checks for obscuring objects in all ranges
Texture and attribute binding fixes.
- texture bindings are always done through ManagedGLContext
- vertex buffers remember their different attribute locations in different shaders
- 3rd level log messages added for texture binding and vertex attribute binding
Small changes on shadow mapping and showing graphics error messages.
- showGraphicsError function created that displays WebGL info
- errors shown when only experimental WebGL support is available and when antialiasing is turned on but is not supported
- bug in shadow mapped shaders disabling gradual appearance of shadows fixed
- indexed texture sampling changed to if-else conditionals (indexing is broken in my laptop's WebGL implementation)
Moved the shadow-mapping matrix calculations to the vertex shader.
- the vertex shader now calculates the positions of the vertices on the shadow maps, and the fragment shader uses the interpolated values
- fine-tuned shadow map range boundaries
Implemented dynamic texture binding and vertex buffer binding management.
- textures can be bound to free texture units automatically, texture units can be reserved for certain textures
- object in scene.js now set the sampler uniforms to the dynamically acquired texture unit indices
- vertex buffer - attribute bindings are now propery managed and updated when needed
- updated the shaders considering the above changes
Fixed two small bugs with showing WebGL support errors and shadow-mapping.
- message notifying of experimental WebGL support should now show up correctly in all cases
- fixed bug causing some parts of an object completely in shadow showing up party lit
Shadow mapping ranges and depth ratio read from XML, scenes can take shadow mapping parameters.
- shadow mapping ranges and depth ratio settings are now loaded from the settings.xml (cannot be modified within the game)
- scenes can be created with different shadow mapping parameters
- shadow mapping can be disabled or enabled at any time with methods for scenes, ranges can also be set
- battle scene take the shadow mapping parameters from game settings, database scene uses custom ranges for the ships
Doubled shadow-mapping precision by pushing the center of the shadow maps in front of the map.
- closed #22: shadow-map centers can now be different and each are moved in front of camera by their own range to make sure the whole area of the shadow map lies in rendered space
- closed #59: compensated flight mode made default
- matrix correction now executed at every simulation step, not just once every 10 seconds
Corrected light matrix calculations to work correctly for all directions.
- fixed #11
Commented shadow-mapping related code in gl.js and graphics.js.
- closed #12
- control settings page makes sure the control context is ready before loading
- default key settings for rolling changed to be next to throttle controls
Started refactoring of logic.js, dust cloud color and range can be specified in XML.