Jasoco wrote:Okay maybe not, but still. I see you have the same z-indexing issue as me. Not really something you can solve without actual per-pixel z-indexing. Also an early version of my engine had shadows too. But I haven't implemented them in my remade version yet.
Yeah, but I do actually have per-pixel z-indexing. And it works perfectly, actually. It's how the shadows work, as well. The problem comes with the actual depth testing. There are these strange artefacts that occur when you write to the same canvas you are reading from, from a shader. Meaning that when I get the depth and match it against the depth already stored, I get problems when I write the stored depth back into the buffer/canvas. But my actual depth buffer works fine, here's a pic of how it's saved: (you can see the artefacts in the upper left and right corners)
Nixola wrote:If I recall correctly, you shouldn't be using the currently set canvas like this, as it could cause this kind of issues
I figured as much. Eventually, anyway. Heh, I spent hours trying to fix my thing, thinking it was something with my code. I finally realized it wasn't a problem with my code, but a problem with love. I tried it in a basic testing thingy where I drew random triangles and prioritized lighter color with a shader (so that they would appear on top), and I got the exact same artefacts.
Roland_Yonaba wrote:What would be very interesting is to share some of your techniques, math and calculations involved in this work as articles or blog posts. If you are inclined to do so, I am pretty sure it would be very learningful to others out there. By the way, is there any chance to abstract the actual code as an engine, so that others can include it as a third-party library to render their own custom "3D" scenes in their games ?
The code is already like an engine, excluding shadows and z buffer, where I have to manually enter all the render settings. Everything else is done from functions to my graphics lib. But like I said, I think I will upload a basic version. Containing only vec3, mat4, and some basic rendering. At least at first.
Jasoco wrote:Hey, Oysi. I'd love to see some video of the engine in action.
Well, I don't have any videos of the newest stuff. I will rewrite and optimize, as it's currently a big pile of frog legs. However, you can check out my youtube channel for some videos of some older stuff:
https://www.youtube.com/watch?v=DDS7d9hlDk8
https://www.youtube.com/watch?v=nPa6KFRSflg (this one has cloth physics =O)
Jasoco wrote:My question is how did you create the scene in those screenshots? Did you use a 3D program that exports a specific file type? Because it's hard enough for me to code the objects I have now by hand. I'd kill for a 3D program that could export in a format I could use. Also, do you split your worlds up into chunks or are you rendering the entire scene at once including stuff not on screen? Man, I'd love to compare notes. I'd be interested in seeing what parallels we used. And if your camera and 2D to 3D math is any different because mine is clunky and doesn't work exactly how a 3D camera should. (Hard to explain without showing it off really.)
I actually used Roblox. The scene in those pictures is from a map in a game that I made years ago. The game got a bit popular, but I went away for a year, never balanced shit, and never consistently updated, so yeah. But the map I made is still nice, though. xD
As for how I render stuff, I would love to go in depth into that, but I feel this post is big enough as it is. My projection is rather simple (and orthodox), in that it's a simple camera:inverse() * vertex, and then do x = x/-z, y = y/-z, and some other stuff for fov and screen ratio.