1013 Commits
Author SHA1 Message Date
Dmitry Stepanov 2259cbb39f fixed redundant texture binding if it is already bound to pipeline 2024-09-02 14:38:48 +03:00
Dmitry Stepanov 6502534d56 conservative occlusion culling
- do not "overcull" objects that does not fit into visibility buffer
2024-09-01 21:49:02 +03:00
Dmitry Stepanov 7046082b15 fixed shaders
- test run on GLES 3.2 found these errors
2024-09-01 18:57:57 +03:00
Dmitry Stepanov 69f588fecc use faster GL_STREAM_READ when reading textures 2024-09-01 11:20:20 +03:00
Dmitry Stepanov 43f0f740c9 fixed frame desync in occlusion culling 2024-08-31 22:42:08 +03:00
Dmitry Stepanov 7991265a4e non-blocking occlusion test 2024-08-31 22:16:32 +03:00
Dmitry Stepanov be4c3575aa use glClientWaitSync with timeout=0 instead of glGetSynciv
- fixes GPU stalls when transferring data from GPU to CPU
2024-08-31 22:15:37 +03:00
Dmitry Stepanov 2c38dc30bb pixel buffer api improvements
- access to image size calculations
2024-08-31 21:30:13 +03:00
Dmitry Stepanov 1895039aa2 pixel buffer for async framebuffer reads 2024-08-31 18:41:50 +03:00
Dmitry Stepanov 2868ea091f fixed terrain shader compilation on webgl2 2024-08-31 00:23:58 +03:00
Dmitry Stepanov 9743fd43cf fixed occlusion culling on wasm 2024-08-30 22:07:23 +03:00
Dmitry Stepanov 4786663d9a use uniform visibility buffer to improve cache utilization
- pass object count in each tile to gpu and not over-iterate there
- improved performance from 1.4 ms to 0.65 ms per frame for visibility test
2024-08-30 16:06:35 +03:00
Dmitry Stepanov de7598d284 more optimizations for occlusion culling 2024-08-30 13:05:42 +03:00
Dmitry Stepanov 26849e4963 slight perf optimization for occlusion culling 2024-08-29 23:41:26 +03:00
Dmitry Stepanov c854051772 checked borrow in occlusion culling
- prevents crash when trying to check visibility of a removed object
2024-08-28 23:31:02 +03:00
Dmitry Stepanov 2aa3dc436a enable occlusion culling by default 2024-08-28 15:49:31 +03:00
Dmitry Stepanov 52c935cd75 fixed frustum culling 2024-08-28 15:44:59 +03:00
Dmitry Stepanov eecfc18e4d use rgba8 pixel format for visibility buffer intead of r32f
- floating point has 23 bits of mantissa, thus it's "binary" precision is limite to that bit count, rgba8 has 32 bit precision which is quite significant
2024-08-28 14:34:54 +03:00
Dmitry Stepanov 6ecced47d0 removed redundant memory allocations each frame 2024-08-27 19:13:14 +03:00
Dmitry Stepanov 98b63b1b53 reduced tile size for better gpu parallelism 2024-08-27 18:40:36 +03:00
Dmitry Stepanov 32a350a8a8 use visibility test data from previous frame
- this is needed, because occlusion culling algorithm uses depth buffer from previous frame and it also must use bounding boxes and view/projection matrices from the previous frame as well
- removes frame coherence problem, by the cost of 1 frame lag in occlusion test
2024-08-27 18:05:09 +03:00
Dmitry Stepanov 353a7e78fc switch to enable/disable occlusion culling 2024-08-27 12:42:32 +03:00
Dmitry Stepanov dbe704c75e use instancing instead of manual vertex buffer formation
- saves some time on cpu + gpu
2024-08-27 11:56:32 +03:00
Dmitry Stepanov d06e9e91de fixed aabb -> screen projection
- handle cases when points go behind near clipping plane
2024-08-27 11:55:33 +03:00
Dmitry Stepanov 79413a95fd optimize visibility buffer on gpu before reading it on cpu
- collapses fullscreen visibility buffer into (w_tiles X h_tiles) buffer, and essentially moves 98%+ of computational complexity to GPU
2024-08-26 20:39:47 +03:00
Dmitry Stepanov 08b50aef9d finished first iteration of occlusion culling algorithm
- it has perf issues and that's for next iteration
2024-08-26 11:43:53 +03:00
Dmitry Stepanov c9cd50f327 various fixes
- fixed aabb projection
- improved perf
- fixed shader
- reduced tile size
2024-08-24 22:49:10 +03:00
Dmitry Stepanov 9acb67809e Merge branch 'master' into occlusion_culling_no_query 2024-08-24 22:38:16 +03:00
Dmitry Stepanov 4e27d96930 PipelineState::flush + finish 2024-08-24 22:38:02 +03:00
Dmitry Stepanov 28b07aca6e get_image for gpu texture 2024-08-24 22:37:27 +03:00
Dmitry Stepanov b30cdd6f0b experimental occlusion test without occlusion queries 2024-08-24 15:11:16 +03:00
Dmitry Stepanov e6e6714498 added R32UI texture format 2024-08-23 23:16:22 +03:00
Dmitry Stepanov e6bbc8f429 read_pixels_of_type to get typed pixels instead of raw bytes 2024-08-23 12:02:49 +03:00
Dmitry Stepanov e35b03ae39 minor api improvements for graphics 2024-08-23 12:01:54 +03:00
Dmitry Stepanov b9852428bb centralized storage for all visibility info 2024-08-19 18:56:51 +03:00
Dmitry Stepanov 94e2bd4ec2 docs for visibility cache 2024-08-19 00:17:01 +03:00
Dmitry Stepanov 6a9d8eef7c made visibility mod public 2024-08-18 21:40:27 +03:00
Dmitry Stepanov 6990a653c6 fixed size calculation of light bounding shape 2024-08-18 21:19:21 +03:00
Dmitry Stepanov 494c7d87e8 remove distant cells from visibility cache
- helps to avoid bloat of the cache
2024-08-18 11:18:23 +03:00
Dmitry Stepanov 56f9ae0439 prevent redundant occlusion queries for visible objects 2024-08-17 21:49:31 +03:00
Dmitry Stepanov e363cbba19 use cone shape to mark pixels in stencil buffer for spot lights
- sphere was too inefficient since spot lights usually have quite narrow "beam"
2024-08-17 20:24:00 +03:00
Dmitry Stepanov 142fd42014 fixed lighting issues when occlusion culling for lights is enabled
- fixed popping light issue
- skip this optimization for directional lights
2024-08-17 12:27:57 +03:00
Dmitry Stepanov 11c697f249 experimental occlusion culling for light sources 2024-08-16 22:29:54 +03:00
Dmitry Stepanov 2d78cec5ae query api 2024-08-15 23:44:22 +03:00
b-guild dfb44de369 Terrain holes 2024-08-14 19:44:04 -07:00
Dmitry Stepanov 6164370ce1 remove native collider when its shape cannot be created 2024-08-14 10:16:36 +03:00
Dmitry Stepanov bc7434c089 license update 2024-08-11 11:45:33 +03:00
Dmitry Stepanov cb6384a03b validation for 2d colliders 2024-08-09 10:35:52 +03:00
Dmitry Stepanov bf7293b2eb support for chained texture nodes in fbx
- fixes normal map import on FBX files made in latest 3ds max/Maya/etc.
2024-08-08 19:00:20 +03:00
Dmitry Stepanov 6ec0190c8d better validation for colliders
- checks handles to geometry sources for validity
2024-08-07 23:54:46 +03:00