Planetside Software Forums

General => Terragen Discussion => Topic started by: westergard on February 15, 2023, 01:17:34 PM

Title: applying a displacement colour shader to an OBJ objet
Post by: westergard on February 15, 2023, 01:17:34 PM
Hi there, i can't find my answer anywhere on this forum so if i double, please redirect me to the post.

I have an OBJ mesh that i have created in blender that is a huge range of mountains. It is the mesh only, not .mat files attached.  I would like to apply shaders like we can do to the terrains, but on this object, and use the altitude constraits.  Is it something possible.  I tried adding it the the object shader but can't make it work.

Any tuto somewhere on how to do that?  Or any idea how to start?  Thanks a lot for your help

Sebastien
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: Kevin Kipper on February 15, 2023, 02:05:58 PM
Hi Westergard,

You'll want to open the OBJ mesh's "internal node network" by clicking on the "+" sign on the node in the Node Editor pane.  That may show you the "Parts Shader" node, so click on its "+" sign which will bring you to the internal node network, which by default will have a Default shader for each surface in your OBJ.  

From there you can apply shaders just like on the terrain.

Title: Re: applying a displacement colour shader to an OBJ objet
Post by: Dune on February 16, 2023, 02:57:09 AM
Any shader used in an object should be UV-based (if image file), or, if procedural, taken through a transform shader set to world scale. Furthermore, when using altitudes, you have to check 'use Y'. For angle/slope restictions you should use a compute terrain or compute normal like you would in the 'normal' line of shaders.
I hope this helps you on your way.
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: Hannes on February 16, 2023, 03:31:05 AM
By the way, you wrote, you have an OBJ, which is a huge mountain range. Since Terragen's strength is to create realistic landscapes, I guess, you'd get the most of your scene, if you'd convert your OBJ into a height map and use it for TG's internal terrain generation or create your terrain from scratch within Terragen.
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: Dune on February 16, 2023, 03:43:53 AM
But maybe it has all sorts of nice overhangs, and that can't be translated into a TG terrain. Otherwise, yes!
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: Hannes on February 16, 2023, 04:24:14 AM
Quote from: Dune on February 16, 2023, 03:43:53 AMBut maybe it has all sorts of nice overhangs, and that can't be translated into a TG terrain
That would indeed be an argument for an imported object.
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: WAS on February 16, 2023, 04:08:16 PM
Quote from: Dune on February 16, 2023, 03:43:53 AMBut maybe it has all sorts of nice overhangs, and that can't be translated into a TG terrain. Otherwise, yes!

There used to be a good tutorial for baking an object to a vector map for blender, but for the life of me, can't find it these days. It was even featured on here years ago. Someone made out a bunny, overhangs and all out of terrain via vector map from a object. With 32bit maps, and todays rendering power, this could be a powerful approach for importing complex geo that is terrain based.
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: Dune on February 17, 2023, 02:18:31 AM
Indeed so, now that you mention it. I also used vdip maps for weird terrains, but never extracted one from a TG terrain. From an obj that would be a different story. In other software you need to have 2 versions of the terrain; one flat, one complete, but - importantly - with the same amount of vertices. Then you bake the difference to an exr.
Something like that, extracting a difference, could also work in TG (from internal terrain, not object). But extracting a vdisp map from TG to use in TG would be quite useless.
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: westergard on February 18, 2023, 08:41:05 AM
Wow!  Thanks so much for your help!!!  I will try all this.
Title: Re: applying a displacement colour shader to an OBJ objet
Post by: WAS on February 18, 2023, 02:11:25 PM