Multiple Vectors in Materials

Hi,

I have a landscape material that places masks at the point of the vector parameters that I have plugged into the opacity mask. It all works fine but if I want more I multiply the below screenshot together and feed it in. The problem is I potentially want 30 or more of these. Is there a way to do this without copying this out 30 times? Which then would have a max limit of masks that could be done.

Do dynamic material instances work in some way on a landscape? Could this be done using a post process?

Thanks for your help.

Hey Tocs,

Could you explain what you are attempting to achieve by this approach? Perhaps there is another way to go about achieving the same results, as creating 30 masks in single material is going to be heavy to say the least (if at all possible).

Landscape materials behave a bit different than regular materials, but you can still instance them and control the parameters in the same way as you would with any other material instance.

Cheers,

Hi Andrew,

I’m making a RTS. I’m wanting to have some buildings that sink into the ground a bit. So in my current setup I can modify the landscape ‘0’ parameter above to the location of the building, which then allows the building below the landscape to be seen.

Obviously in its current setup I would limit the amount of buildings that could be placed depending on how many vectors I put in the material. Currently I have 8 in there that seems to work ok.

As far as I understand the collision of the landscape can’t be modified during runtime unless it were to have major engine modifications?

If you know of another way to do this then that would be great.

Thanks,

Tocs

When you say ‘sink’ do you physically want to place the buildings past their bottom within the landscape, and then you wish to see the overlapping parts through the landscape?

I am a bit confused as to what you are trying to do, but it sounds like you are on the right track. Are you placing these building procedurally, and what effect are you trying to achieve?

Thanks,

Here is a screenshot that essentially shows it. It has a sphere that uses the landscape visibility mask at that point.

89992-landscape+hole.png

The way I have it now I would have to limit the amount of buildings that use the sinking effect to say 5 each and if there were 5 buildings that use this I would have to tile 25 of the setups I have above.

It would be great if there was a way to have a vector array in materials that could run each of the vectors in the array. That way it would be dynamic and would grow and shrink to the size I needed it.

Is there another way that could be achieved? The only other options would to have a limit on the amount of buildings or not use buildings that are below the landscape, which I’m planning on putting a quarry in so it would be hard not to have a hole in the landscape for it.

One thing I have just noticed is the shadow gets blocked also even though you can see through it. Is there a way to allow the light to go through?

Thanks,

Tocs

You can enable the shadow two sided on your landscape so you get shadows on both sides of your landscape. I am still a bit confused as to what you are referring to by the ‘sinking’ because the screenshot you provided looks like you have cut a whole using the visibility brush and just placed the cube mesh partly inside.

Is there a reason you don’t simply sculpt your landscape, including the quarry, and then place the houses so they appear like they are sinking? Like will your house be actively sinking into the ground? You could use parallax occlusion mapping to offset your ground textures and make it appear your geometry is seamlessly connected to the landscape. I guess I am still a bit confused as to what you are still trying to achieve with this material set up. You mention sinking effect, but simply placing your object further in the ground will achieve that effect.

Thanks,

Sorry for any confusion. All the buildings will be placed during runtime and most will be placed on the surface of the landscape. All the locations will be static. Sorry sinking is more of an action word, I should have used sunk.

Some of the static meshes will have negative z parts of it (like an open pit) that will be below the insertion point on the landscape. So if it is placed, the landscape will block the visibility of it of the negative areas.

With my current landscape material I should be able modify the ‘0’ vector parameter to the insertion point of the static mesh, which will then cut a visibility mask into the landscape at that point and allow the negative z meshes to show.

So with parallax occlusion mapping I could use it to lower the landscape in the areas I need it? Could this method be dynamic that could increase or decrease depending on how many buildings are spawned? Could it be be done using a decal?

Sorry if I am confusing as I’m not an artist so a lot of my terminology is probably wrong.

Thank you for your patience.

Tocs

No worries, and I appreciate the clarification.

So parallax occlusion is an enhancement of the parallax mapping technique. Parallax occlusion mapping is used to procedurally create 3D definition in textured surfaces, using a displacement map (similar to a topography map) instead of through the generation of new geometry.

I created a tutorial for how to set up parallax occlusion mapping, and a simple example of how it can be used. I am not 100% sure if you can use it for decals since they are unique in how they behave compared to regular materials.

Parallax Occlusion Mapping

In my case I actually just used a mesh I created which has some curvature, and applied the material to the mesh. You can “pull” or “push” the effect to achieve risen or sunken look.

If you want to stay on the route you are working towards, remember you can always layer materials (advanced) and then use a number of material instances to use a large number of vector parameters that are all tied to one master material as well.

Cheers,