Comments (2)
Using a depth image object as texture won't work unfortunately (and it should warn about this in the validation layer, looks like I forgot a check).
The reason (at least for GL) is that a sokol image with depth-pixelformat is created as a glRenderBuffer object (see here:
Line 2738 in ce6414d
IFIR the reason for this was various compatibility problems with GLES2 platforms (unextended GLES2 and WebGL doesn't have depth textures)/
If you need the depth texture visualization only for debugging purposes I'd recommend using a 3D API debugger like RenderDoc. If you need the depth content otherwise one solution would be to render the depth into a image texture from the pixel shader (but if you need to run on lowend platforms, also keep in mind that single-channel float32 textures might not be available everywhere, for the shadow map in this demo: http://floooh.github.io/oryol-samples/wasm/BulletPhysicsBasic.html I used the RGBA8 encoding from this blog post: http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
Cheers,
-Floh.
from sokol.
thanks for the explanation @floooh!
I will try copying the depth buffer into a texture; that should work for me (only targeting desktop systems).
closing this issue.
from sokol.
Related Issues (20)
- [sokol_imgui] Manage ImDrawCallback_ResetRenderState HOT 3
- [sokol_gfx] Array of struct uniform HOT 1
- WebGPU samples currently broken. HOT 1
- Regression: swapchains with depth (not depth/stencil) buffers currently broken in Metal. HOT 2
- [sokol_app] A call to GetIntegerv in _sapp_wgl_create_context leaves the stack corrupted HOT 8
- Sampling a depth texture using `SG_IMAGESAMPLETYPE_FLOAT` in order to copy it to the main framebuffer's depth buffer HOT 2
- Crash on validation error HOT 2
- sdhc + sokol_app.h: Uniform Arrays of smaller than vec4 type lead to validation errors or silently introduce buggy behaviour HOT 5
- Will you accept a PR that allows setting minimum width/height for resizable windows? HOT 3
- Apps showcase HOT 2
- Why isn't SOKOL_NO_ENTRY supported on android? Is it impossible or just not implemented yet? HOT 1
- How to fill the new sg_swapchain struct when using SDL2? HOT 1
- support arm64-v8a - INSTALL_FAILED_NO_MATCHING_ABIS HOT 4
- Load graphical dynamic libraries on demand with dlopen HOT 6
- sokol_gfx: warnings when compiling with mingw-w64 HOT 3
- sokol_app.h: request for show/hide/focus window functions HOT 1
- Request for Tagged Releases HOT 6
- README gives no indication of what this library does HOT 1
- [sokol_gfx] Any plans to support base vertex location? HOT 12
- error: expected '(' for function-style cast or type construction, while using SG_RANGE on MacOS using c++ HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sokol.