I'm having a hard time prying myself away from the computer since I've gotten into 3D coding with Gideros, having been away from 3D work for a number of years. I mentioned on another thread that I was looking into whether Gideros's 3D support was usable for a new fishing game I have planned, or if I'd need to use pre-rendered textures and build the game in 2D. I dabbled in Unity, but didn't care for the layers and the interface, and would much rather work with a system that just lets me load or create meshes from Blender models, and code all the behavior directly. I'm thrilled to find that Gideros can do a lot more than I would have guessed. Sure, there are limitations, like no support for models with animated armatures, as far as I know, but for an engine that's primarily 2D, it can do plenty of 3D.
Today I made a custom shader that handles aerial perspective (fog, to make distant objects look distant), and to fog underwater objects relative to the depth and the viewing angle, plus water clarity, basically specialized fog that only applies below the surface. So far that's working fine on the landscape, but not with other subsurface objects, so it still needs work, but the effect on the lake bottom is exactly what I had in mind. It's my first experiment with a custom shader, and I clearly have a lot to learn, but it's an encouraging start. I've improved the heightfield code for performance, tried swapping in a landcsape mesh with 16 times more detail than I was using, and it still behaves nicely. I changed my water surface animation method to apply just to the area around the viewer, rather than over the entire body of water, which allows me to scale up the whole world greatly without hurting performance.
If anyone is interested in the heightfield landscape code, or the fogging shader, let me know and I'll share some modules.
Here's the progress so far:
Paul
Comments
https://deluxepixel.com
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: SinisterSoft, oleg, MoKaLux, MobAmuse
Likes: MoKaLux
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Here's what my project looks like with another week of progress:
I've fixed some things in the height field mesh generation, fixed the underwater shader and improved the main shader, added programatically generated lakes with variable geographical features, changed the controls from buttons to sliders, added swiping from the center to look around, and today I added a system that populates the world with objects (trees, etc) a zone at a time, fading them in as you approach, and fading them out and removing them from the scene when they're far away. There are still some artifacts in the landscape objects, and there's lots of improvement to be made there, and everywhere, but this has been a good test of performance.
Even with object density cranked up pretty high, it's still plenty smooth on a Galaxy S10. An old GS4 can only manage around 10 fps at that level, but one can always decrease the amount of scenery detail on slower devices.
Likes: oleg, MoKaLux, Apollo14, hgy29, talis, antix
For decent 3D we'd need occlusion culling, mesh combining, mesh LODs, benchmarking drawcalls/triangles, etc. And lots of other stuff.
Honestly, it'd be better for Gideros to become solid 2D engine with support of industry standard SDKs that are required by every mobile publisher, shader editors, particle editors, etc. Or it will become neither fish nor flesh.
(if someone asked my opinion)
Likes: oleg
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: SinisterSoft, MoKaLux
One aspect of Gideros that's been hugely helpful is the sprite child hierarchy. That makes it simple to make sure all the solid meshes in the scene get rendered before those using alpha textures, so that alpha areas don't occlude items behind them. Those objects with textures with alphas become children of a sprite that gets added to the scene after the sprites containing solid objects. The child hierarchy also made it efficient to add detail elements (vegetation, etc.) to the scene a zone at a time as they approach, and fade and remove them when they're far away. Each zone just get sprites (one for solids, one for objects with alpha) with children for all the detail items, so all the detail items for a zone can get added or removed together.
Even if Gideros never tries to become a full featured 3D game engine, but just continues to provide some of the basics that people can build on as needed, it's plenty powerful for the game I have in mind, far more capable than I expected. I also find it much more straightforward than Unity or other engines I've tried.
Likes: hgy29, MoKaLux
In the last couple of weeks I've overhauled the algorithms I use to generate landscapes and lakes, improved the water shader, sped up building and populating of the world with details (vegetation, etc.), articulated the outboard motor and electric trolling motor on the boat, rebuild the boat console, made the gauges (fuel, battery, RPM and speed) functional, implemented the core of a fish locator (sonar), and created animated fish, just one species so far. Right now the fish just swim around. I've yet to give them proper AI, or make it possible to fish for them. I've built an animated fishing rod (one of several the game will eventually have.) I've had challenges in essentially cutting a hole in the water surface, so the boat doesn't appear to be half flooded. The solution is to add a 0-alpha mesh over the interior of the boat, rendered before the water animation, and not applying the water shader to the boat when viewing it from a first-person view. The more complete solution would be to split the boat into interior and exterior models, and applying the water shader only to the exterior. Next, towards making it possible to actually fish, I'll either animate a 3D fisherman, or decide to limit the player to first-person views and only have to animate the anglers forearms, as they use fishing rods, drive the boat, land fish, etc.
There's a lot of features planned for this game, between 1,000 and 2,000 hours of work, but I'm confident the result will be a much better game than the Windows game I wrote years ago. That's giving me a lot of models and textures to work with.
If people want to discuss the pros and cons of Gideros supporting 3D, we can start a thread for that. In fact I think I'll do that. Meanwhile I'll use this thread to share what I'm learning through the project, if anyone is interested.
Likes: MoKaLux, SinisterSoft, Apollo14, antix
Likes: MoKaLux
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)