It is currently Sat Aug 22, 2020 12:22 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: My first Unreal Engine game (Work In Progress)
PostPosted: Sun Oct 30, 2016 5:38 pm 

Joined: Fri Sep 30, 2016 3:30 am
Posts: 14
My first Unreal Engine game. Currently a work in progress. The terrain is generated randomly at runtime, and is almost endless, like Minecraft. I'm going to work on blending the transition between grass, dirt and stone.

Image

Here's a list of software that I used to make it.

Unreal Engine 4.13
https://www.unrealengine.com/what-is-unreal-engine-4

ANL
http://accidentalnoise.sourceforge.net/

OceanProject (cascade256 4.13 fork)
https://github.com/cascade256/OceanProject/tree/4.13

PolyVox
https://bitbucket.org/volumesoffun/poly ... ch/develop

Vegetation Pack
https://forums.unrealengine.com/showthr ... tarter-Kit

Runtime Mesh Component
https://forums.unrealengine.com/showthr ... ted-meshes!

UE4 Tools Addon (for blender)
http://www.lluisgarcia.es/ue-tools-addon/


Top
Offline Profile  
Reply with quote  
 Post subject: Re: My first Unreal Engine game (Work In Progress)
PostPosted: Mon Oct 31, 2016 8:29 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Looks very nice, and fast quick mesh updates :-) Material blending is quite challenging but I look forward to seeing how it works out!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: My first Unreal Engine game (Work In Progress)
PostPosted: Wed Mar 01, 2017 1:17 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
For Material Blending I already have a solution. I think I described it once in the Crafterria thread.

You know you can mix up to 4 materials per vertex.
What if we can, however, have different set of materials per triangle?
This is what I am doing in my projects. 4 Materials per triangle.

Each triangle need to have its own ID. The ID must be same for all vertices by the triangle.
This ID is used to lookup actual Material Indices from a lookup texture that is using integer format!

I've ended doing this because if Unity's limitations, however, you can basically encode 4 ids in a UV4 4-vector channel, however a Vertex Id and a lookup texture gives you basically A LOT of vertex attributes.

E.g.
Triangle 1:
v1: pos, normal, tangent, color(blend factors RGBA), whatnot, uv2(1,2,5,6)
v2: pos, normal, tangent, color(blend factors RGBA), whatnot, uv2(1,2,5,6)
v3: pos, normal, tangent, color(blend factors RGBA), whatnot, uv2(1,2,5,6)

Then, in the pixel shader, you do your usual texture splatting and triplanar texturing,
but use the IDs that will NOT be interpolated to select what texture to use.

For best looking results like these in Crafterria, you should use Texture Array (sometimes they call them Array Samplers) - You load all your texture into a texture array with mipmaps, an you are ready to go. Just don't mistake a Texture Array with 3D Texture - with Textuyre Arrays you get correct mipmaps, they are basically wad of images but with third dimension to access the specific image.

Of course such algorithm requires some preparations, and you will need to calculate your splatting ids on the CPU. And in case more than 5 materials want to contribute to single vertex.... Ignore the least contributor completely and use just the top 4 ranked contributing materials. Trilinear interpolation code is needed for this.

This screenshot shows the idea. Notice that most of triangles have contributions set to (1,0,0,0) and only the Red channel contribution is used, however, the per-triangle-id table points to different texture id.

In places where blending is needed, Red, Green and even Blue and Alpha channels are used to implement the splatting as and if needed.
Attachment:
idea.jpg
idea.jpg [ 202.85 KiB | Viewed 11397 times ]


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

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