Search Unity

RSP - Relief Shaders Pack on Asset Store

Discussion in 'Assets and Asset Store' started by tomaszek, Dec 5, 2012.

  1. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi orb,

    Extrude shaders uses grayscale texture as "height/depth mask". Pixels that are sampled to be darker than 0.5 are pushed down with selected (extrude height material param) value.

    Give me a screenshot an just ask if you've got any problem using the shaders.

    ATB, Tom
     
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Cheers, that makes it clear :)
     
  3. Deleted User

    Deleted User

    Guest

    Hi Tom,

    is it possible to combine RSP with vertex blending? I would like to add variation to a street by hand painting it with a combination of 3-4 textures (e.g. grass, sand and stone). I found the plugin Vertex Painter v2 which also supports custom shaders, but only those which are written to blend based on vertex color. Does RSP provide this option?

    Or do you see any other way to achieve my goal?

    Thanks!
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'll definitely add some shaders to RSP which will provide such functionality. This moment RTP release is the most important work to do. More - in incoming RTP3 you'll find a few shaders that make something similar - thay can be put on blended geometry on the surface of terrain and alternate layers by vertex color (2). However they work only as parallax mapped while RSP gives us many more better parallax toys.

    Tom
     
  5. goatytimes

    goatytimes

    Joined:
    Sep 23, 2013
    Posts:
    9
    Very impressed with the steep parallax shaders, much better than the ones I've seen in other packages. But... I'm getting these polygon seams at the end of the distance transition. Anything that can be done about this?

    $RSP.jpg
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm thinking, but the best would be giving me example setup - mesh+texture+shader used+it's params - so desirably a quickly made package with problematic setup as private message so I can look into this. I see you're using DX11. nVidia ?

    ATB, Tom
     
  7. goatytimes

    goatytimes

    Joined:
    Sep 23, 2013
    Posts:
    9
    Yeah, I'm using an Nvidia card, but the same thing happens in DX9. Actually it only happens when AA is enabled, which should have been obvious now that I think about it. It also only happens on the normal steep parallax shader and not the silhouette one. I'll try to send you a more detailed description.
     
    Last edited: Sep 28, 2013
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    A quickfix that worked for me is like this:

    find this line in shader (around line 259):

    float delta=_HeightMap_TexelSize.x*_WAVELENGTH/IN.dist.x/length(EyeDirTan.xy);

    and replace with this:

    float delta=_HeightMap_TexelSize.x*_WAVELENGTH/length(EyeDirTan.xy);

    Should work in most cases.

    Tom

    P.S. What I see I have to tweak these shaders more for better quality (texture MIP LOD choice is not much good now). I'll try to update package in near future (weeks), too.
     
  9. goatytimes

    goatytimes

    Joined:
    Sep 23, 2013
    Posts:
    9
    Excellent. That worked perfectly, thanks.
     
  10. BrainMedicine

    BrainMedicine

    Joined:
    Sep 3, 2013
    Posts:
    3
    Hi, Tomaszek. I want to buy a shader, but I do not know one thing - it works for 9 or 11 directx version? In your online demo of what directx used?
     
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's DX9, DX11, OpenGL compatible. It doesn't use DX11 tesellation features. Remember that DX11 is still reserved to PC desktop deployment. Webplayers can not show DX11 specific features I believe.

    Tom
     
  12. Salvorite

    Salvorite

    Joined:
    Aug 1, 2013
    Posts:
    2
    Alright, I need some help. I'm trying to use the built in tool to create a distance map. I'm using it on one of the example height-maps in the package (specifically Assets\ReliefPack\Textures\ReliefShaders\Pavement\pavement.png, the black and white one). The distance map it creates is completely blank. The RGB channels are all black and the alpha channel is empty. What might I be doing wrong?

    FYI I'm using Unity Free 4.3.4f1

    Thanks!
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Will try to check this in newest Unity tomorrow

    ATB, Tom
     
  14. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    I have the same problem with the pro version4.3.4f1

    Also I'm now getting an error with distance map shaders I think its the UV error described in the manual but I don't understand the fix.
    $DistanceMapShader_error01.jpg

    $DistanceMapShader_error02.jpg
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi,

    Sorry, I still wasn't able to look into this (headache with some other tasks). Anyway I'll try hard to give you answer / solution ASAP.

    Kindest Regards, Tom
     
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    About black, no output of distance map praparation script. This relies on alpha channel of source texture, so beside of making texture readable, you need to mark "alpha from grayscale" so that alpha channel is available. Sorry, I haven't described this in docs. In next update (I'm heavy loaded with new RTP this moment) I'll handle such situation from script level (marking automaticaly texture as readable and making sure alpha channel is present).

    ATB, Tom
     
    Last edited: Feb 28, 2014
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    OK, found it. Culprit was distance texture sampling which is meant to be linear. This is not issue of Unity4, but as more and more developers use Linear lighting textures that were linear in gamma are no longer...

    Means - tick "Bypass sRGB sampling" in distancemap texture settings to make sure it's properly sampled using any lighting model.

    Tell me if this solves your problem.

    ATB, Tom
     
  18. FelixLeChat

    FelixLeChat

    Joined:
    Nov 18, 2013
    Posts:
    2
    Is it possible to have your shader with a Transparent mode? I would like to use your shaders in my 2D/3D game and I'm putting 2D textures on Quads. Actually, your shaders fill the alpha channel with a white colr. Thx! :)
     
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You can simply make it transparent - it's just a surface shader, but remember that occluded "virtual geometry" from parallax effect won't reveal real semi transparent behaviour.

    Tom
     
  20. orbobservation

    orbobservation

    Joined:
    Feb 28, 2013
    Posts:
    87
    Hello, I seem to be running into a problem with the steep parallax- on the left is the heightmap that comes with rsp and the one on the right generated with my heightmap tool. It loads into other engines with results more akin to yours so I'm a bit confused, I've scanned through the readme and can't seem to find an answer as to why my result has the more liquidy parallax effect.


    $ar1.jpg
     
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Would be simplier to tell if you give me screenshot of your texture together witll all its properties from Unity's texture importer inspector (does it have alpha or not - main suspect is that alpha channel of your heightmap has some useless data from the RSP shader point of view)

    Tom
     
  22. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    Thanks, that fixed it.
     
  23. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    Sorry about asking for help again so soon but now that I've got the distance relief shaders working working I have a problem with the curvature tool for the steep parallax shaders.
    It isn't showing up under the "Window/Relief Tools" I just have the 4 in 1 texture thing for terrain textures and the converter for distance maps.

    Thanks in advance.
     
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I've just sent you link to the patch via forum PM.

    ATB, Tom
     
  25. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    That fixed.

    Thanks again
     
  26. cjmanca

    cjmanca

    Joined:
    Dec 6, 2013
    Posts:
    10
    Couple of questions

    1) Is it possible to make distance mapping more variable? I'm working with a heightmap that has many different heights in it, but currently the distance map seems to be only lowest or highest, which means that part of my texture is at maximum height, and other parts are minimum height, but none are in the middle.

    2) The tool for creating the necessary heightmap for parallax mapping doesn't show up in my Window->Relief Tools menu, so I can't even try parallax mapping right now...

    EDIT: One more thing I just noticed is that when a texture starts to tile, there are gaps in between each tile (see attached picture)... This seems to be especially noticable on spheres. I really need to know how to fix this!

    EDIT2: I think I know what's happening with the gaps... it seems to be related to the silhouette UV cut. By fiddling with those numbers, I can make the gaps disappear, but that leaves strange artifacts at the edges of objects (since it's no longer doing an alpha cut there). I'm not sure what a good solution would be to this, but it's not very usable right now. Hopefully you'll have a solution for me :)
     

    Attached Files:

    Last edited: Mar 24, 2014
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    1. Distance maps are just like this - 1/0 height logic and sidewalls extruded aligned to u/v axes. You can only make them a bit more "jaggy" (in terms of extruded edges). Although they can not make "any" heightmaps they are extremely fast (2-3 texture looksups to100% precisely resolve parallax calculations).

    2. You can turn off sihouettes uv cut inside shader code (comment its #define keyword in defines section at the beginning, just below property block).

    About missing scripts - I know about this bug. For some unknown reason scripts just .. vanished from Unity's package after submission... To fix it quick (to get missing scripts) you can PM to me with order number and preferably invoice PDF of RSP copy bought (you get an email with pdf in the attachment from assetstore when buying). I can send you missing script.

    Tom
     
  28. cjmanca

    cjmanca

    Joined:
    Dec 6, 2013
    Posts:
    10
    I thought it may be something like that.
    Yes, I found that too. It's a bit disappointing though, since it means that you can't use the nice UV cut corners on non-square surfaces, or on larger surfaces. I found a temporary workaround by making several different materials with different UV cut settings, so that it only cuts one or two sides, and tile it manually, but it's time consuming. Maybe I'll look into a way to modify the script to do auto-UV cutoff settings based on verts... I'm already starting to familiarize myself with it in other ways, as I had to dive in to fix another visual artifact with sidewall shadows.
    Sent you a PM, but couldn't find attach options there, so need another way to send the pdf.
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I've just sent you back missing stuff.

    Tom
     
  30. TFK_XGame

    TFK_XGame

    Joined:
    Feb 15, 2014
    Posts:
    2
    Hello,
    I would really like to buy this back, but I noticed some strange behaviors in your demo scenes.
    First of all, in the second demo, the textures on the walls look really bad, they do not form actual bricks. Plus it would be useful to have an AA option, currently your demos have a big amount of aliasing. Also, being able to control the clipping distance (both in those demos and in the RTP ones) would be great to have a real AAA style (because, yeah, clipping at 5meters looks weird).
     
  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    POM techniqyes doesn't provide with easy to achieve AA options. Would mean slowing down shader because it then need to suersample each pixel (realise 2x2, 4x4 and so on POM raytracing operations inside). It's better to use SSAA techniqyes (as postprocess) to compensate it. Could you give me screenshot of brickwalls looking bad ? Maybe there is something wrong with new Unity player versions and your hardware. I haven't updated RSP for some time, I hope I'll be able to refresh it a bit in enar future...

    Tom

    P.S. You can use any distance as limit for POM rendering, but setting this high makes no visuals difference while is unnecesarilly slower
     
  32. Axiomatic

    Axiomatic

    Joined:
    Feb 7, 2014
    Posts:
    30
    Forgive the uneducated nature of my question. What does the computational increase look like while using this same version of this shader on many of the same objects. How would performance typically be impacted? Does the unique position in space for each pixel remove the possibility of reducing calls among prefabs scattered across a scene?
     
  33. Hotsun

    Hotsun

    Joined:
    Aug 11, 2010
    Posts:
    122
    Supporting a second normal map as detail is really appreciated...
    I know it's not that hard and I can do this for now by myself but every time you make an update I have to read the shaders and add those lines carefully so if you add this as an update(separate shaders) not only you helped us all but also your package will be more unique ;)

    Thanks a lot :)
     
  34. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    476
  35. ndoxx

    ndoxx

    Joined:
    Jul 7, 2013
    Posts:
    17
    Hey Tom,

    Pre-buy question : does your shader could take Diffuse + Specular IBL (from skyshop)?
     
  36. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    476
    We haven't heard from Tomasaz for a couple months here!
     
  37. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    I was wondering if there was any chance you will be updating these shaders to use pbl like you did with your terrain shaders?

    Thanks again.
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    As I'm following my sales on this pacakge from time to time, I must say I haven't expected any activity on this thread either... That's my fault. So I'll try to answer questions one by one.

    It's all done in pixel shader - so computational increase is only when you try to increase number of pixels rendered by my shader. If you sort them front to back (a general rule followed by Unity for opaque objects) you pay only for first pixel, rest won't be rendered (will be optimized/culled by GPU). Drawcalls are not related issue here. It's matter of how many objects you're trying to render. If objects share the same material you can gain on static and dynamic batching (reducing CPU load).

    Generally - RSP shaders are not that expensive as they might look like. They are several times faster than, for example my RTP (terrain) shaders. For moderately modern GPUs (like GT400 series and up) they cost power that can be easily neglected (like 0.5-1ms per whole HD screen fill) even with most advanced shaders used (POM selfshadowing). For cheaper ones (like extrusion maps or procedural shaders) - they simply cost nothing in current desktop situation :).

    Yes, RSP also would need some refreshment and new ahders. The problem is, as always - time. I'd rather invest it into product that sell, not "niche" one that's almost not used (officially).

    Yes, possible procedurally, but implementing this for one user request alone would be too much luxury, sorry :).

    As I said - I'd need to refresh whole product and add IBL/PBL which is todays one of the most requested things. Currently it's not implemented (you would need to make it yourself) but in time - I guess I can make it as far as I'd see there anything good spending 2-3 weeks onsomething that almost doesn't sell... :)

    Yes, sorry :)

    Answered above...

    Kindest Regards, Tom
     
  39. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85


    With them are not selling I can understand not adding any more features. It is so surprising that shaders as good as these are not selling like crazy!
     
  40. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    When speaking about high-end PBL parallax shaders. You might look here:

    http://forum.unity3d.com/threads/modular-pbr-scifi-pack.257239/page-2

    This is high-end modular package with bunch of top-notch textures/materials. For a few days I was messing around to implement reasonable PBL implementation as surface shader (original included was ShaderForge) to handle all possible render scenarios (forward/deferred/lightmapping). You might ask why I did it - apart from it's help for my friend the package itself is way too good to leave it alone. So, even more than polishing shader included in [Modular] I added POM here and worked it over again. So - you can expect good PBL POM and DX11 tesellation shaders in next release of [Modular]. And maybe I'll also work it over more (self-shadowing, alternate parallax methods like QDM for very "hollow" textures which makes my POM working slow).

    So, the opportunity to work on PBL on RSP just has come :) because I'd like to include such most advanced POM shader to be present on RSP soon. I'll try to include a few screenshots here when they are ready. As I tested DX11 tesellation - it's very valuable in situation when you'd like to have silhouettes working out of the box, but I've realised that tessellation can introduce some problems in case of very sci-fi - technical heightmaps. I'll try to show it here, too. However for organic materials like stones/trees tesellation works better (problem it's still unavailable on many platforms and GPUs even those fast enough to handle my POM shading with ease).

    ATB, Tom
     
  41. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    So any word on getting your parallax solutions to work with the Unity 5 Standard shader?

    I would be very interested, especially if it would be faster than tessellation.
     
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm just about to submit UBER which will be succesor of RSP. It's Standard shader with additional features + a lot of parallax effects. On performance side - everything depends on what you treat with POM, which technique is used, parameters and so on. Anyway - tesellation wins when we need precise silhouettes on complex objects. While on cylinders POM silhouette technique is quite performant, using this on any object can be expensive. RSP can't make it precise anywaty, but UBER can do. UBER will be also capable of tessellation. So - I would recommend to stay tuned because I want to present new stuff here next week (I need to be ready before Unite Europe where I'd like to show it to the public).

    Tom
     
    StaffanEk and blueivy like this.
  43. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi Tom,

    I'm also interesting in then RSP - Relief Shaders Pack for Unity 5.1.
    1) Does they all work with the new release 5.1?

    2) Is this object shape a plane mesh or a b/w texture?
    Untitled-1.jpg

    3) Would it be possible to create such a surface with a simple bw texture?
    and the depth relief with your common technique?

    4) Would the relief technique shader more perfomant than a object is created by polygons?

    kind regards,
    Roger
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    This object is based on extrusion map technique. We've got lo-res grayscale texture (256x256). Extrusion is made with threshold (everything above 0.5 on the texture is ceil, the rewst is bottom). Here the bottom is cut. A sneak peak for this kind of shader:




    Note that in UBER we've got depth writing option up and running and can be seleced with one checkbox in material inspector. That's why objects can intersect each other and cast/receive shadows basing on modified depth (optional self-shadowing technique is also available).

    For performance. One object might be no problem and would probabably work faster, even if it has 30k tris (that would be need to extrude that smooth curved sidewalls). But when it comes to have 100 such objects in the scene - predict the performance yourself (hires poly x 100 = gazillion of polys to be rendered). This POM technique is of rather low cost, but beware of big empty areas in your grayscale extrusion texture viewed at grazin angles - ray catser in fragment shader will need to make quite a lot steps to resolve (although steps are very cheap here).
     

    Attached Files:

    blueivy likes this.
  45. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Fascinating.

    Could you give a ballpark estimate about the performance difference between this and tessellation?

    I notice that Oculus Rift really doesn't like tessellation.I get huge fps variability when using Tessellation and the Rift.

    How does this perform with organic surfaces? I was surprised how good the default Unity 5 standard parallax looks on organic shapes. everything pops out nicely with stereoscopy.
     
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    For heavily tessellated mesh the performance of my POM techniques seems to be quite competitive I'd believe. For oculus - you need to process twice as many polys (for 2 cameras) - that's why your performance drops. Since VR has relatively lo-res display, POM might be better here, because it costs as much as number of pixels actually rendered.

    Couldn't resist to put another screenshot here - it's POM (not two state extrusion). And it behaves quite nice comparing to tessellation (anyway isn't slower when we tessellate mesh to similar precision level).



    Tom
     

    Attached Files:

    Last edited: Jun 3, 2015
  47. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi again,

    a technical question. Would it be possible to create a straight extruded edge with a small b/w texture ?
    Or,.... will be a straight edge made by multiple round dots or squared texels?

    If a edge made or squared texels, then its possible to build up a straight edge with a small texture.

    How does the extrude work?
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    For above POM it's just grayscale texture. For these disks it's grayscale texture but with special treatment. It's small 256x256 but I'm using threshold at 0.5 so we still get smooth sides. For space station (look at the beginning of this thread - source texture is 256x256 B&W - that is black or white) texture.

    Tom
     
  49. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Sorry, you didn't answer the question about Unity 5.1. Does the shader will work with?
     
  50. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Looking forward to the new updates :).