A question about Simple3D color blending (and maybe ray tracing?) #2125
-
Hello @Xeltalliv, This question is mainly for you. Yes, I know the reference to RT in the title seems out of place, but have patience and bear with me as I attempt to express my insanity with words and explanatory context. I'm here in hopes that I will be able to communicate my concerns with you and more easily reach you than on your Scratch profile. The Simple3D documentation says that the extension can be used for 2D projects due to instancing, that "despite lack of programmable shaders, it is still quite powerful," and "rendering into textures allowing multi-pass rendering and more advanced clipping than Clipping & Blending extension." So this is where the fun begins. Having years of prior experience with raytracing and path tracing in Blender, Unreal Engine 5, Three.js, and other softwares--although never having previously written a ray tracer--and having a detailed familiarity with the basic concepts of how raytracing is computed, I decided I would attempt (whether successfully or unsuccessfully I do not know) to write a screen-space-2d-limited-ray-tracing-like-post-processing(ish) effect in Simple3D with some very primitive global illumination (and possibly reflection features). The idea was both to enhance my programming abilities and as a proof of concept for the true power of "Simple"3D, not because it would be easy or a good idea, but actually because it was a bad idea. Considering that the development of #1974 has brought the possibility of large-scale, performant triangle raycasting to Turbowarp, and with Simple3D's transformation and color capabilities, I thought it might be possible (although definitely not feasible) to make some sort of global illumination effect in Simple3D. All that to say is, here's my problem: Additive blending in Simple3D. Either I'm doing something wrong, or drawing/instancing a mesh with additive blending doesn't blend additively with other draw calls/instances of itself, only other meshes. Additionally, the pen extension, although it can blend additively in Clipping & Blending, does not appear to interact with Simple3D or its blending features in any way, and I'm pretty sure this is confirmed by looking at its source code. So my question is: Is self-mesh additive blending in Simple3D possible, and if so, how? Is Simple3D blending with the pen extension possible? Alternatively, I've considered creating a hybrid rasterization and ray tracing rendering engine utilizing Pen+ V7's shaders, which would probably be much easier, but why do easy when you can do hard? Yes, it's stupid, and yes, it probably shouldn't be done, but that's why it hasn't been done yet. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
insanity |
Beta Was this translation helpful? Give feedback.
-
It should work. Perhaps you forgot to disable Z-buffer testing, so only the first thing gets drawn, and the latter ones fail because they aren't closer. Or maybe it's some weird quirk of your GPU.
Not currently. You have additive blending within Simple3D layer and additive blending within pen layer. But the thing that composites different layers together doesn't have a way to control blending. |
Beta Was this translation helpful? Give feedback.
It should work. Perhaps you forgot to disable Z-buffer testing, so only the first thing gets drawn, and the latter ones fail because they aren't closer. Or maybe it's some weird quirk of your GPU.
Not currently. You have additive blending within Simple3D layer and additive blending within pen layer. But the thing that composites different layers together doesn't have a way to control blending.