Lasse Öörni
a4aed67509
Optimized deferred shadowed directional light shader in both HLSL & GLSL.
2011-12-14 22:51:03 +00:00
Lasse Öörni
2d5cfd889e
Restored earlier use of forward lighting shader interpolators to fix rendering bugs on Intel 3150.
2011-12-14 08:29:19 +00:00
Lasse Öörni
b3aa4c6c37
Removed unneeded shader code.
2011-12-13 22:26:52 +00:00
Lasse Öörni
35c21f06d7
Removed the fallback shadow code, as GPUs that actually need it are also too low-performance to render shadows acceptably.
2011-12-13 22:22:46 +00:00
Lasse Öörni
bb8d706428
Corrected the data type of the FogParams uniform.
...
Removed unused GLSL code.
2011-12-12 07:47:55 +00:00
Lasse Öörni
95e9d73403
Output unnormalized normals to the G-buffer as a slight optimization, as the light volume shader will normalize in any case.
2011-12-11 23:55:11 +00:00
Lasse Öörni
86d9004c63
Small optimization to GLSL material pass shader.
2011-12-11 23:22:26 +00:00
Lasse Öörni
b9e62689f2
Freed up pixel shader uniforms.
...
Allow defining material specular color instead of just intensity.
2011-12-11 23:16:49 +00:00
Lasse Öörni
9478103cd0
#ifdef vertex lighting shader code.
...
Added missing dependency for GLSL shaders.
2011-12-11 11:15:23 +00:00
Lasse Öörni
720a19dea3
#ifdef the shadow HLSL/GLSL code to potentially speed up shader compilation.
2011-12-11 10:49:52 +00:00
Lasse Öörni
d14b968e79
Removed unused G-buffer shader code.
2011-12-11 10:38:21 +00:00
Lasse Öörni
0f04185efb
Fixed edge filter for OpenGL.
2011-12-08 23:23:58 +00:00
Lasse Öörni
b2fae0ccb4
Added FXAA edge filter.
...
Updated readme for upcoming release.
2011-12-08 23:19:04 +00:00
Lasse Öörni
d7884cbfa5
Fixed missing masked pointlight rotation on OpenGL light pre-pass mode.
2011-12-07 22:12:46 +00:00
Lasse Öörni
c4e569879d
Restored the optional lit base pass optimization, but with the limitation of no ambient gradient.
...
Removed unneeded GLSL shader permutations.
2011-12-06 21:36:03 +00:00
Lasse Öörni
d607c59137
Added OpenGL hardware depth path for light pre-pass (for now NVIDIA-only.)
2011-12-05 16:13:11 +00:00
Lasse Öörni
a54a526471
Fixed HLSL light buffer sampler index.
2011-12-05 00:28:54 +00:00
Lasse Öörni
0626f46fa8
Fixed missing light pre-pass rendering on OS X by not binding the light buffer to the same texture unit as the shadow map. Unbind buffer textures after use.
2011-12-05 00:09:43 +00:00
Lasse Öörni
21c8926da3
Fixed OpenGL light prepass capability detection.
...
Fixed PackDepthRGB().
2011-12-04 23:03:46 +00:00
Lasse Öörni
9c40326a8c
Pack linear depth to RGBA manually to comply with FBO specification.
2011-12-04 22:55:08 +00:00
Lasse Öörni
e5dca926cb
Fixed possible negative specular lighting in OpenGL mode.
2011-12-04 17:20:24 +00:00
Lasse Öörni
c27ab40f7f
Check needed OpenGL extensions more carefully.
...
Cleaned up unnecessary GLee code.
Initial OpenGL light pre-pass rendering.
2011-12-04 16:38:14 +00:00
Lasse Öörni
6927daf567
Combined G-buffer shader interpolated variables.
2011-12-03 22:00:28 +00:00
Lasse Öörni
8de93e90ad
Removed unused shader code.
2011-12-03 20:55:42 +00:00
Lasse Öörni
1b71cc600e
Added missing file.
2011-12-03 19:08:10 +00:00
Lasse Öörni
644c37a099
Mark light masks to G-buffer stencil for light culling.
...
Fixed OpenGL forward rendering.
Documentation fixes.
2011-12-03 17:51:18 +00:00
Lasse Öörni
4beeb72cd2
Disregard normals in billboard vertex lighting.
...
Removed light stencil masking toggle, as there is no corresponding mechanism in light pre-pass rendering, and toggling it off usually results in a large performance drop.
2011-12-03 15:51:35 +00:00
Lasse Öörni
f9bfd4948f
Shader refactoring.
...
Removed ambient + lit pass combining for less shader permutations, and to prime the Z-buffer with a lightweight pass in case there is a large amount of overdraw.
Moved ambient light calculation to the ambient pass vertex shader.
Added render mode toggle to the editor settings.
Note: OpenGL rendering is currently broken.
2011-12-03 14:06:35 +00:00
Lasse Öörni
cbbf1a74f9
Fixed non-shadowed spotlights in light pre-pass rendering.
...
Removed fallback pre-pass rendering due to objectionable visual quality.
2011-12-02 23:49:41 +00:00
Lasse Öörni
7e3be41dfb
More fixes to light pre-pass light volume rendering.
2011-12-02 21:48:46 +00:00
Lasse Öörni
ceee03d828
Light rendering fixes.
2011-12-02 13:23:31 +00:00
Lasse Öörni
c0d05666f8
Initial light volume rendering.
2011-12-02 08:22:37 +00:00
Lasse Öörni
fefa7bf6cd
Initial light pre-pass rendering. Lighting not rendered yet.
2011-12-01 23:57:16 +00:00
Lasse Öörni
c20e0ada86
Added initial light pre-pass shaders.
2011-12-01 09:35:03 +00:00
Lasse Öörni
abf00cafa9
Merged pixel shader uniforms.
...
Script code cleanup.
Added LightTest script.
2011-11-29 23:15:34 +00:00
Lasse Öörni
65af224fa6
Removed zero-length file.
...
Disabled shader compilation warning related to vertex lights.
2011-11-27 19:47:02 +00:00
Lasse Öörni
47f77d1d1c
Fixed GLSL shaders.
2011-11-24 18:47:58 +00:00
Lasse Öörni
3cf25e801a
Do not use "camera centered" coordinates for light calculations.
2011-11-24 18:38:03 +00:00
Lasse Öörni
bc5dd97e4b
Allow 6 vertex lights.
2011-11-21 07:54:31 +00:00
Lasse Öörni
a51afb0631
Initial vertex lighting support.
2011-11-21 00:17:52 +00:00
Lasse Öörni
642cde63d5
Cleaned up Unlit shader code.
2011-11-13 22:14:30 +00:00
Lasse Öörni
1b08deec28
Fixed editor gizmo movement in local axes mode.
...
Added local Z-direction ambient color gradient support to Zone.
Draw Zone debug geometry as an oriented bounding box.
Shader code cleanup.
2011-11-12 21:35:12 +00:00
Lasse Öörni
668da79dc4
Added SM3 requirement to instancing shaders.
2011-10-27 20:35:44 +00:00
Lasse Öörni
41f5aeae88
Reduce shader permutations by requiring diffuse map for normal & specular mapping.
2011-10-27 20:08:25 +00:00
Lasse Öörni
163688c577
Removed unnecessary GLSL shader variations.
2011-10-27 19:57:37 +00:00
Lasse Öörni
0be37e8495
Shader refactoring. Forward shader split to Ambient, BlinnPhong, Unlit & Volumetric.
...
Added support for multiple variation groups to ShaderCompiler & GLShaderProcessor.
2011-10-27 19:51:14 +00:00
Lasse Öörni
960b8de398
Folded GetShadowPos() back into the lighting shader code as the function contains light-specific #ifdefs.
2011-10-27 07:56:33 +00:00
Lasse Öörni
8fb7ee1a69
Fixed GLSL code.
2011-10-27 07:00:39 +00:00
Lasse Öörni
bef427937c
Lighting shader code cleanup.
...
Automatically set black fog color for additive blending, so that shaders do not necessarily have to take it into account themselves.
2011-10-27 06:57:47 +00:00
Lasse Öörni
75d74ea3f1
Removed unnecessary #ifdef from varyings.
2011-10-26 22:24:13 +00:00
Lasse Öörni
ce811badc3
Removed unnecessary shader permutations.
2011-10-26 22:20:46 +00:00
Lasse Öörni
dd9597a5ae
Removed unnecessary #ifdef.
2011-10-26 21:27:11 +00:00
Lasse Öörni
0a6538f069
Further shader cleanup.
2011-10-26 21:15:12 +00:00
Lasse Öörni
d0cdfd6f1e
Shader code cleanup.
2011-10-26 20:27:39 +00:00
Lasse Öörni
4f9f83eaab
Made the move mode arrows smaller to match the scaling mode axes.
...
Corrected documentation about fallback mode shadow filtering.
2011-10-21 20:05:57 +00:00
Lasse Öörni
00dbad68cb
Added different axis models for the rotation & scaling modes.
2011-10-18 19:55:05 +00:00
Lasse Öörni
b11b0f8de1
Initial gizmo-based node transform editing.
...
Fixed material assignments in the axes model.
Possibility to add unculled drawables to the octree.
2011-10-16 23:59:53 +00:00
Lasse Öörni
a32f0f1c26
Fixed rotation of the axes model.
...
Added ray-frustum intersection test.
Added accurate raycasts for point and spot lights. Directional light now never returns a raycast result, as it has an "infinite" bounding box.
Added better debug visualization of a point light.
Reorganization of the editor script code.
2011-10-16 14:53:14 +00:00
Lasse Öörni
fc0c9aff06
Added manipulator axes model.
2011-10-15 21:48:21 +00:00
Lasse Öörni
7c42215d98
Fixed possible normal map Z reconstruction overflow.
...
Fixed font size inconsistencies in the editor node window. Increased attribute name font size.
Merged Light's cascade split attributes into one Vector4 attribute.
Show local ID's in the editor in a more readable way.
2011-10-10 19:10:27 +00:00
Lasse Öörni
a9c5641371
Return to xGxR encoded normal maps and separate specular maps.
...
Instead of double buffered VBOs, avoid glMapBuffer & glUnmapBuffer in "discard" mode and use a CPU-side buffer instead.
Reduce UI & DebugRenderer vertex buffer size if grossly too large.
Updated documentation. Suggest AMD's Compressonator utility for normal map processing.
2011-10-07 21:30:02 +00:00
Lasse Öörni
74b995c29a
Use 2 shadow map samples in fallback mode.
2011-10-04 06:48:13 +00:00
Lasse Öörni
1421058c9f
Even more optimization of the shadow mapping shader. In 4 sample mode, pre-adjust the shadow map coordinates on the CPU.
2011-10-03 08:21:26 +00:00
Lasse Öörni
d51452b6bd
Further optimization of the shadow mapping shader.
2011-10-03 06:50:36 +00:00
Lasse Öörni
2ae6aa0b2b
Restored missing comment.
2011-10-02 23:11:19 +00:00
Lasse Öörni
c880535788
Optimized shadow mapping instruction count & performance on non-NVIDIA GPUs.
2011-10-02 21:51:20 +00:00
Lasse Öörni
41b67a245a
Use more aggressive LOD on Jack.mesh.
2011-10-02 14:58:03 +00:00
Lasse Öörni
0e84c54306
Added shader parameter register count information in the D3D shader file format.
...
Added tracking of last assigned shader parameter per hardware register to D3D9Graphics. This allows reusing shader registers for different parameters in different shaders.
Removed the ElapsedTime shader parameter, as wrapping it is problematic depending on the calculations it would be used for.
Removed support for bool & int shader parameters from Graphics, as bool constants are not supported in OpenGL 2.0, and int parameters are not (at least currently) needed, and can lead to worse performance.
2011-10-01 09:28:27 +00:00
Lasse Öörni
af890623a8
Fixed batch state sorting.
...
Tidied up lighting shader #ifdefs.
2011-09-30 11:01:41 +00:00
Lasse Öörni
589c0ee141
Expanded the lit base pass optimization to cover also the first spot or point light affecting a drawable.
...
Do not render light to stencil if camera is inside the light volume.
Added optimization for directional light shadow casters that are fully occluded by another shadow caster: do not render the lit pass for them.
Removed the alpha masking hint. Alpha test no longer gives the batch a lower priority.
2011-09-29 22:53:16 +00:00
Lasse Öörni
fd06d3cf4a
Fixed component ID overwrite when copy-pasting scene nodes in the editor.
...
Fixed light's bounding box not updating on light type, range, fov or aspect ratio change.
Fixed possible light stencil volume clipping bug when approaching a point light.
Fall back to non-specular or non-shadowed shaders if the desired light shader variation does not exist.
Unified order of light vertex & pixel shader variations.
Added support for enum accessor attributes.
Added light stencil mask toggle in the editor.
2011-09-28 19:19:28 +00:00
Lasse Öörni
cd2de4b25b
Shadow map UV offsets optimization.
2011-09-28 06:49:33 +00:00
Lasse Öörni
5139e5322e
Use alpha test instead of discard in shadow shaders for very slight speed gain.
2011-09-27 21:21:27 +00:00
Lasse Öörni
9ba1e748a5
Fixed unclamped specular calculations.
2011-09-27 19:31:18 +00:00
Lasse Öörni
b7c32f5887
Fixed unlit shaders possibly referring to nonexistent vertex normal, causing the D3D debug runtime to complain.
...
Set z = w in skybox vertex shader, instead of rewriting depth in the pixel shader.
Fixed GLSL shaders.
2011-09-27 18:29:06 +00:00
Lasse Öörni
8f921642cd
Returned to Blinn-Phong equation for more pleasing specular highlights.
2011-09-27 06:59:55 +00:00
Lasse Öörni
80a6948b22
Large rendering architecture refactoring.
...
Optimized shaders to do more work in the vertex shader.
Deferred rendering removed, at least for now.
Switched to RGB normal maps, with specular intensity in the alpha channel. Removed NormalMapTool.
Optimization of light influence on objects by stencil masking.
Split shadowed lights are now rendered in one pass. A virtual shadow depth cube texture is used for point lights.
Refactored shadow map allocation. Allow to use lower resolution shadow maps than quarter size.
Added the Polyhedron math object, used for improved shadow map focusing.
Reversed the convention for the plane intercept parameter.
Math-related code cleanup.
2011-09-26 21:56:31 +00:00
Lasse Öörni
fe495f6bcc
Added deferred fallback mode, which renders the G-buffer in 2 passes.
...
Made the OpenGL extensions mandatory to unify expected functionality with Direct3D9 mode.
2011-09-10 19:28:59 +00:00
Lasse Öörni
d6a3f89393
Added low-quality (1-sample) shadow filtering option.
...
Refactored fallback shaders so that they are compiled as variations into the SM2 directory.
2011-09-09 20:41:56 +00:00
Lasse Öörni
292ebed51f
Added initial fallback mode (no MRT, no hardware shadows.)
2011-09-08 23:12:48 +00:00
Lasse Öörni
c65998f0e3
For a slight speed gain, do not draw a GBufferFill fullscreen quad when hardware depth is available, instead just clear the diffuse buffer.
2011-09-08 07:03:47 +00:00
Lasse Öörni
80aee649df
Re-enabled lit base pass optimization, with more careful checks to ensure proper rendering order.
...
Fixed temporal AA shader GLSL syntax for ATI GPUs.
Code cleanup.
2011-09-04 14:30:42 +00:00
Lasse Öörni
8f2005f7b8
Fixed temporal antialiasing shader when INTZ depth is not used.
2011-09-02 18:44:31 +00:00
Lasse Öörni
56be63eca6
Fixed shader code.
2011-09-01 07:21:40 +00:00
Lasse Öörni
a89cb22161
Replaced edge filtering with temporal antialiasing with ghosting prevention.
2011-09-01 07:19:32 +00:00
Lasse Öörni
630edabb4b
Fixed directional lights and fog in OpenGL orthographic mode.
2011-08-29 18:22:11 +00:00
Lasse Öörni
e5ad79494b
Re-enabled INTZ depth support in deferred mode.
2011-08-29 07:06:41 +00:00
Lasse Öörni
da685e99de
Ported optimizations and code cleanup from the prepass-branch.
2011-08-29 00:53:05 +00:00
Lasse Öörni
9859b10b35
Fixed deferred orthographic mode OpenGL shaders.
2011-08-28 14:40:16 +00:00
Lasse Öörni
f0ecda9785
Fixed numerical stability in Quaternion matrix constructor.
...
Fixed spotlight wrong size in deferred rendering.
Removed "first light" optimization pass due to buggy interactions with alpha blending.
Fixed morphWeights property naming on AnimatedModel.
Fixed missing shader combinations.
Ported the GraphicsTest example from Urho3D 1.0.
2011-08-24 03:52:41 +00:00
Lasse Öörni
d0ab5fb7d6
Disabled shader branching from lighting calculations as on some GPUs it has a dramatic negative performance impact.
...
Added -noflush command line option to disable GPU command queue flushing before rendering.
2011-08-20 14:12:16 +00:00
Lasse Öörni
424f7a957f
Enabled warnings in ShaderCompiler.
...
Optimized physics debug geometry drawing.
Branch only in expensive pixel shaders (shadowing or specular lighting.)
Added more default colors to Color class.
2011-08-14 17:38:03 +00:00
Lasse Öörni
fa80179bdf
Fixed to compile and run on Ubuntu.
2011-06-18 23:30:18 +00:00
Lasse Öörni
19a40e561b
Removed unused pixel shader uniforms.
2011-06-17 07:46:32 +00:00
Lasse Öörni
3bb01cb0ed
Added threshold value to the edge filter.
2011-06-15 16:24:50 +00:00
Lasse Öörni
83bf3d1464
Switched to NVIDIA FXAA II based edge filter.
2011-06-15 13:33:16 +00:00
Lasse Öörni
bea4f054c7
Tweaked the edge filter.
...
Fixed missing stencil buffer when using deferred antialiasing under OpenGL.
2011-06-15 06:56:19 +00:00
Lasse Öörni
87f9bbd846
Switched back to a edge filter for deferred antialiasing, as temporal antialiasing causes problems when both the camera and objects move.
...
Fixed infinite loop in HashMap copy.
2011-06-14 21:10:27 +00:00
Lasse Öörni
ed3751e1f8
Fixed ambient quad shader.
2011-06-13 06:43:08 +00:00
Lasse Öörni
1c5e878832
Check that render targets are supported before allowing auxiliary views.
2011-06-13 06:41:47 +00:00