1
\$\begingroup\$

I need to fill a weapon bag with foam material.

This is what it should look lik:

enter image description here

The material in the upper part of the bag looks like this:

enter image description here

I'm using HDRP.

How could I do this?

Thank you!

Edit: I have played around with Parallax Occlusion mapping, and I got this result.

Edit2: I am not sure if I use the Pixel Displacement as it has been suggested to me.

Also, I'm not sure if I use it the correct way:

I have created a Height map and put it into the Height map slot. This doesn't create any effect. I have to put the same map into the Base map slot in order to see the effect. If I put a black image into the Base map slot or if I choose Black as the Base color, no effect is visible.

I don't understand why this is so. I think even if my Base map is black, the Shader has pixels that it can move.

This is my height map: enter image description here

Edit 3: It was suggested that I should use a normal map. This doesn't look at all what I expected. The normal map was created from the Height map using an online tool:

enter image description here

By Philipp's answer I found out that the normal map alone is not enough.

\$\endgroup\$
1
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – Vaillancourt
    Jul 19, 2019 at 23:31

1 Answer 1

4
\$\begingroup\$

A heightmap changes the position of the texels, but not their color shade. If you want some parts of the texture to be brighter and others darker depending on how they face the light source, then you want a normal map.

I used the texture you provided as both a normal map and a height map and created this material:

result

For the normal map image, select the import settings "Texture Type: Normal map" and switch on "Create from Grayscale". If you apply the import settings, the texture should appear light blue in the editor:

normal map

If you also want to use the same texture as a heightmap for displacement, then you need to create a copy of the image under a different name, so you can apply different import settings. It will work with the default settings, but because we only care about the brightness we don't need all 3 color channels. So you can reduce a bit of overhead by turning it into a "single channel" texture:

height map

These are my material settings. I highlighted all values which I changed from the defaults: material

Further steps you can take to improve these textures further:

  • Make both maps less "pointy"
  • Add some noise to the normal map
\$\endgroup\$
5
  • \$\begingroup\$ Thank you for the lesson!! Do you suggest noise to the normal map because that would simulate pores in the foam? \$\endgroup\$
    – tmighty
    Jul 20, 2019 at 13:11
  • \$\begingroup\$ @tmighty Yes, that's why. \$\endgroup\$
    – Philipp
    Jul 20, 2019 at 14:01
  • \$\begingroup\$ Do you have any idea how to make the foam spikes less pyramidal? \$\endgroup\$
    – tmighty
    Jul 20, 2019 at 15:11
  • \$\begingroup\$ Can you please share your project somewhere? I don't seem to be able to get the same results as you do. \$\endgroup\$
    – tmighty
    Jul 20, 2019 at 17:35
  • \$\begingroup\$ Can you share you project? \$\endgroup\$
    – tmighty
    Jul 21, 2019 at 15:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .