Skip to main content
Participant
February 3, 2016

How do i make textures more 3d with the VR?

Hi,

If you try the demo Gear VR example - Dreadhalls and you look behind when you start, you see a 3d stone wall with part of the walls popping out at you. With unity, regardless of if I use a heightmap and normal map, I can't get it to look that 3d! Do I need to use something like blender to build a mesh (the texture will sit on this) based on a heightmap to get it to look that 3d? What's the trick to making it this 3d? My textures still look flat with the VR on even with a heightmap applied.
    This topic has been closed for replies.

    12 replies

    Inspiring
    February 3, 2016
    If I recall correctly, Dreadhalls uses parallax mapping, not just normal mapping. Unity has some simple built-in shaders for this (http://docs.unity3d.com/Manual/shader-N ... ffuse.html), but they won't look correct in VR. You would have to compute a height map and use parallax occlusion mapping, relief mapping, or displacement mapping. Be careful - all of these techniques are performance-intensive. Here is an Asset Store package with some of the above techniques: https://www.assetstore.unity3d.com/en/#!/content/5705.
    Inspiring
    February 3, 2016
    Wouldn't it be "cheaper" for mobile platform to model such details and have LOD on the models ?
    Inspiring
    February 3, 2016
    Gear VR apps are typically bound by draw calls, mesh complexity, texture bandwidth, and pixel shader complexity, roughly in that order. But yes, actual geometry and aggressive level-of-detail optimization can be faster if you are texture- or pixel shader-bound. Parallax, parallax occlusion, and relief mapping cost a lot of pixel shader and texture bandwidth, but they may fit if your app is heavily draw call or geometry-bound. Be sure to profile your app to see where it is spending its resources.
    Participant
    February 4, 2016
    Ok, trying to understand this. When i select parralax diffuse from the legacy shaders, i dont get a "height" slider option as in the example with the brick texture here -

    http://docs.unity3d.com/Manual/shader-N ... ffuse.html

    It looks worse as there is no metallic anymore and only diffuse,normal map and height map. Regardless of the greyscale heightmap, i cant get it to create a bumpy surface.


    If i use the standard shader and change the height value next to the heightmap, the whole polygon raises (even though i have a heightmap texture selected with shades of white and gray and black). Does the normal map texture need to have the alpha values set accordingly for the height?

    So can you even do parralax occlusion mapping with the standard shader?

    Do i need to buy a shader to do this etc like " uber standard shader ultra?"
    Inspiring
    February 4, 2016
    "agentdark64" wrote:
    When i select parralax diffuse from the legacy shaders, i dont get a "height" slider
    You should. For me, it's right below "Main Color".

    "agentdark64" wrote:
    It looks worse as there is no metallic anymore and only diffuse,normal map and height map.
    Yes, the Standard Shader supports parallax mapping if you provide a height map. But it's even more complex than the basic Legacy/Parallax Diffuse shader, which makes it harder to use on mobile. You could also use the Parallax Specular shader to get a little bit more control.

    "agentdark64" wrote:
    If i use the standard shader and change the height value next to the heightmap, the whole polygon raises
    The height slider is a scale that applies to the whole heightmap as h = h * height - height/2.0. You can see how it gets used Unity's built-in shaders by looking at ParallaxOffset1Step in UnityStandardUtils.cginc and ParallaxOffset in UnityCG.cginc.

    "agentdark64" wrote:
    So can you even do parralax occlusion mapping with the standard shader?
    No, you would have to modify the shader or use a third-party shader such as the ones I previously linked from the Asset Store.
    Participant
    February 5, 2016
    Does parralax occlusion mapping take into consideration the normal map in its calculations? Because whatever heightmap i give with plenty of whites and blacks makes no difference in making my texture bumpy. And increasing the overall height just raises the whole polygon up.

    I even bought uber standard shader ultra and the whole polygon still just raises. Grrr.
    Inspiring
    February 5, 2016
    The shaders work for me. Do these images work for you? https://www.digitalrune.com/Blog/Post/1 ... ax-Mapping

    If you have a Rift DK, try them on PC first in case the shaders are running with reduced functionality on mobile. I'll take a look soon.
    Participant
    February 5, 2016
    This is what it looks like setup:

    Changing the height slider makes the whole polygon move in and out.

    I thought it would be more 3d than this.
    Participant
    February 5, 2016
    Even if I use the UBER standard shader ultra, it still don't work...
    Participant
    February 5, 2016
    Hi, I was having the same question and found this thread. For me the Legacy Shader only kind of worked, but the Standard Shader works just fine. It looks like this: