x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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. alt text

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

Thanks for your help.

Product Version: UE 4.11
Tags:
landscapemask.png (108.1 kB)
more ▼

asked May 05 '16 at 12:57 PM in Rendering

avatar image

Tocs
93 8 11 17

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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,

Andrew Hurley

more ▼

answered May 06 '16 at 07:35 PM

avatar image Tocs May 07 '16 at 03:45 AM

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

avatar image AndrewHurley May 09 '16 at 03:26 PM

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,

Andrew Hurley

avatar image Tocs May 10 '16 at 01:10 AM

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

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

landscape hole.png (189.8 kB)
avatar image AndrewHurley May 11 '16 at 09:13 PM

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,

Andrew Hurley

avatar image Tocs May 12 '16 at 04:00 AM

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

avatar image AndrewHurley May 12 '16 at 02:25 PM

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

https://wiki.unrealengine.com/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,

Andrew Hurley

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question