It is currently Sat Aug 22, 2020 3:40 am


All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Fri Jun 19, 2015 8:40 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Looks very nice! Are you using the new lighting system in Unity 5? Now that Cubiquity is free I'm planning to drop Unity 4 support and play around with some of these fun new features. The physically based rendering is something I'm particularly interested in, though I'm not quite clear how well it applies to dynamically modifiable objects.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Fri Jun 19, 2015 9:32 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
PBR just works :) But GI is a problem.

Also, I render my terrain multipass, 4 materials per pass... with Surface shaders! :)
It seems to work like a charm. Manual blending mode and keepalpha pragma makes mu splat shader actually work. You can see that I achieved the material blending with per-vertex alpha value for correction, and a Splatting Passes Texture that is sampled using vertex texture fetch.

This way I achieved the multi-material support - per vertex but it looks perfect :)
After I fix all the splatting bugs, I will describe how the terrain rendering works for me. I had to use 2 set of normals, however - the Polyvox normals for splatting and unity's default normals for lighting. I have some problems with normals - when I render them, they look yellowish rendered, but lighting works. Polyvox's ones look red/green/bluish, Splatting works with them, but lighting is completely broken... and I don't have idea why. The opposite effect - if I use Unity's Mesh normals [that come as well from polyvox) - Splatting is broken, but lighting works.

Usity is doing something with the normals, probably storing them differently, so I get different values for lighting and different from splatting.

The Triplanar texturing shader is the old ogre function touched a lot to avoid glitches, but it works. See the "Bug" screenshot :)

Overall, what I am doing now:

I am storing the game world in chunks of my own gfArray3d<VT>. VT is a struct I posted earlier, but a litle bit smaller now.

When I extract Marching Cubes mesh, I construct 20x20x20 Polyvox::RawVolume<uint8_t> and fill it only with the densities. I run the extractor on it, then I run the decimator (0.8) on it and keep both meshes. The original mesh is used for rendering, the decimated one for physics.

For each vertex in the original mesh, I get the vertex position and then calculate the trilinear interpolated alphas value for it. MAterials maps to colors: RGBA - set to 1 either, so when I interpolate these, I get a "color" that encodes the splatting alpha levels. I do this based on the passes data - and generate a NPOT texture with width = vertex count, height = pass count, and each pixel are the intterpolated splatting alphas.

I pass the vertex, index, alpha buffers and splatting texture to unity and construct the mesh data there - the both meshes for rendering and physics, the 2D texture with splatting alphas per vertex/pass and then I setup shader passes and render them.

By using MwshRenderer.sharedMaterials[] with more than 1 generated materials, you make unuty render mesh multi-passed.

Then smile :) and time to go to Lunch now.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Sat Jun 20, 2015 5:30 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Very interesting! I really look forward to reworking some of the graphical aspects of Cubiquity materials and lighting) and seeing what Unity 5 will do... but there's lots of things to improve in the background first. I'll be sure to refer to this when I come to it!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Tue Aug 04, 2015 2:00 pm 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
There are some more screen shots of my progress:
The teenager was made using Mixamo.

Also, the project is now on Vanilla PolyVox 2.1, I reverted all my patches, but now only use the Marching Cubes with RawVolume during extraction. I still keep all else in my own containers, and I no-longer use decimation for physics meshes due to performance tradeoffs, but may decide to bring decimation back if Unity's Mesh Colliders become slow.

Image
Image
Image

And a bug that got interesting:


Attachments:
800-under.jpg
800-under.jpg [ 49.84 KiB | Viewed 6984 times ]
Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Sat Aug 08, 2015 5:10 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Looking really nice! Still glad you switched to Unity? There are some painful aspects but I think the increase in productivity is worth it :-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Tue Aug 11, 2015 8:34 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
In High Quality rendering mode, I still have problems with material blending over 4th material - because additive rendering does not add normals together but blend them, instead.

I have good diffuse / albedo map, but normals and AO maps get darkened borders on the borderline of first pass and next passes :)

About the rest: I'm Okay with Unity for now :) Caveats have reasons. Camera shaking and object instability ==> Update vs FixedUpdate :)

Now, I'm working on the player and basic movement / player controlling [wrote one in 2 days]
Then, the nightmare called IK Math for Pickaxe hits will start, but we already have a s**tload of Vector Math Features that will probably help me a lot. And in Unity 5, we have Mecanim with its [awful/awesome, depending of your experience] IK that may somehow help me with this :)

Long term TO-DO list:
Grass blades, Grass shader, Entity system [C++ to Unity level],
Server planning, entity model, meshless and unity-less collision "detection" [hinting]...
For sure, implementing the server will be huge PITA, because I still don't know how to implement it - as separate C++/Qt executable or a Unity headless server. Former have performance benefits, simple console app that don't even depend on PolyVox and Unity, but collision checking on a density field will be PITA so player / NPC movement prediction will be out of control.
On the other side, having Unity Server will make parallel / Dream worlds simulation difficult, but I'll have my collision properly working, so this is what must be properly planned.

After that, I have to write my own geometry extracton feature that will extrude shapes and calculate their culling. Difficult task, but this will make the geometry stylization of Crafterria, and this will make it different than Minecraft, 7 Days To Die and the rest.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Wed Aug 12, 2015 9:36 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I'm sure IK will be a lot of work but will be cool if you can get it working. Maybe Unity does it for you, as you say. Graphics in modern games are pretty good but still the physics and animation always look slightly wrong.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.4][WIP] Crafterria
PostPosted: Fri Aug 14, 2015 8:15 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
I prefer GOG approach [Gameplay Over Graphics, not Good Old Games :d]

Really, I should focus on gameplay and features, not on graphics "whores" :) [sorry for the badword]


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.5][WIP] Crafterria
PostPosted: Fri Oct 09, 2015 12:14 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
Well, the time for the new bump has been come.
I'm rewriting the entity system so no trees this time :(

Here are the newest screen shots:
Image
Image
Image
Image
Image

Playing with the GUI and starting basic game state development, and working on rendering and some such stuff.

Also, Adobe bought Mixamo - latter is free completely for limited time - go to make your characters before it's too late. The worst part is that I'm lating :D


Top
Offline Profile  
Reply with quote  
 Post subject: Re: [Upd.5][WIP] Crafterria
PostPosted: Sun Oct 11, 2015 3:56 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Very nice, the material blending looks as good as always. Also I see you have an integrated command console - was this your own work or did you find an external asset?


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net