Jump to content

[SOLVED] I need to assign detail materials more 4 to a surface.


photo

Recommended Posts

Hello,

The alternative way: if you need more than 4 materials for one surface - divide the surface into several surfaces.

 

Terrain surfaces can't be split into several ones.

 

4 materials per surface means 4 detail materials, each terrain surface has individual diffuse texture with unique color information.

 

You can increase resolution of diffuse texture on specified terrain surfaces if you need.

  • Like 1
Link to comment

Terrain surfaces can't be split into several ones.

 

4 materials per surface means 4 detail materials, each terrain surface has individual diffuse texture with unique color information.

 

You can increase resolution of diffuse texture on specified terrain surfaces if you need.

 

Thanks for the answer but my question was for a way to increase "number" of detailed materials on one surface, not "resolution". Is there a way that we can use more than 4 detailed materials at one surface?

 

According to the manual, it appears we can mask unlimited numbers of materials if we use 3D texture of R8 format, but we don't know how to do this. Could you please let me know how we can add 3D texture?

Link to comment

Thanks for the answer but my question was for a way to increase "number" of detailed materials on one surface, not "resolution". Is there a way that we can use more than 4 detailed materials at one surface?

 

According to the manual, it appears we can mask unlimited numbers of materials if we use 3D texture of R8 format, but we don't know how to do this. Could you please let me know how we can add 3D texture?

 

It's impossible to create more than 4 materials per surface because we haven't free texture units for material detail textures.

Link to comment

It's impossible to create more than 4 materials per surface because we haven't free texture units for material detail textures.

 

What about a DX10+ only mode where 8 or 16 detail textures could be stored as 8-/16-layer Texture2DArray (=1 texture unit only) ? RGBA mask indexing texture could use

 

a) for 8 detail texture approach only 4-bit/16 levels blend weigths per detail texture

a) for 16 detail texture approach same indexing scheme as previous texture palette (weighted blend of 4 textures from 4 columns).

Link to comment

Yeah on DX10+ level hardware we can use any number of materials per surface.

All detail material textures can be stored in single diffuse and normal array textures.

Unfortunately art assets will be not compatible with old DX9 level hardware.

Link to comment
  • 1 year later...

For some of the customers this DX9 incompatibility is not a problem at all.

And high quality result is the most important for them and they don't mind to use DX11+.

One of the goals of Unigine was (if I remember correctly) high quality graphics. That was one of the reasons I selected Unigine. Sticking to DX9 is against this goal.

 

So why not add some parameter to select a minimal needed DX level, and add support for features a lot of users really would like to see.

Link to comment

In D3D9, can't we add a new shader pass that splats four more textures on to the terrain ( I mean the mesh_terrain_base material ) ?

But the documentation is very scant about adding a completely new pass. Can adding a pass be done exclusively through the .mat file? Or do we need access to the Unigine cpp codebase to set textures up, blend between passes, set new shader constants etc.?

I tried once, but couldn't figure out how to control blending between passes, like other engines support modulate, add etc.

Link to comment

@ulf I find this very limiting. Other engines like OGRE, which IMO is not as advanced an engine as Unigine gives the client the flexibility to add passes through material scripts. This is an invaluable tool in many situations. Though I agree that an extra pass is more costly, in many cases it's an acceptable trade off.

I do not fully understand Unigine's renderer ( haven't seen the code, only read the documentation ) so maybe this limitation is due to the architecture (part deferred/part forward?).

It'd be really nice to have better documentation on extending shaders and materials, especially about which shader constants to use (eg: how to get world space vertex position etc.). To compare, OGRE shines in this regard, their material system is really comprehensive when it comes to extensibility.

Link to comment

I think its more related to overall design philosophy. OGRE render engine has been design from the ground up for C++ and low-level shader extension. While beening extremely flexible and powerful, this nearly always requires in-depth, extensive programming and engine knowledge, with the possibility to totally crash the lower-level render engine on run-time.

 

UNIGINE game engine key design philosopy focused on much more high-level, ease-of use game enigine (not only render engine) programming based on scripting and customization of pre-designed base materials and engine features. While requiring much lower programming knowledge to get high-quality results quickly this approach is problematic when it comes to low-level engine modifications.

 

On the other hand the mentioned migration from UNIGINE forward to mixed forward/deferred render engine has been nearly unnoticable, while other engines require complete re-work of application/worlds/shaders etc. As always each approach has its pros and cons.

 

Nevertheless based on multiple customer posts here on the forum the need for in-depth UNIGINE low-level C++ programming capability seems to be a more and more required feature especially for large-scale, high-end applications.

Link to comment

Would it be possible to set the UV coords on a texture to say 0.0,0.0,0.5,0.5 then have the texture tile around those coords... that way you could atlas several tiling textures onto the one image map?

Link to comment

Previous UNIGINE terrain used such an approach with a total of 16 materials packed into one atlas. I think the drawback was that this approach had to use large material texture borders to avoid tiling/filtering artifacts. So it was quite memory intensive.

Link to comment
  • 3 weeks later...

Ulf is right, atlases require heavy shaders - textures adjoining seam is a big problem.

Instead of using detail materials you can do the following:

  • Paint directly on the diffuse texture (for example, one once you get it split per-surface, that should be more convenient)
  • Use various decals - there's no limitation on that whatsoever

Link to comment
×
×
  • Create New...