Home Technical Talk

Decal technique from Star Citizen

123457

Replies

  • Menchen
    Offline / Send Message
    Menchen polycounter lvl 3
    LiuYang said:
    Talked to a guy from Unreal and he mentioned something about customizing DeferDecal.usf file to enable metalness and maybe other cool stuff. I'm completely no idea about coding, if anyone could figure this out and share it would be awesome.
    If you have the full conversation, could you share it with us? He might have given some ideas/instructions on how we could do so. Wouldn't mind learning HLSL just for this, but I think @MACHIN3 also knows the language.
  • LiuYang
    Offline / Send Message
    LiuYang null
    Menchen said:
    LiuYang said:
    Talked to a guy from Unreal and he mentioned something about customizing DeferDecal.usf file to enable metalness and maybe other cool stuff. I'm completely no idea about coding, if anyone could figure this out and share it would be awesome.
    If you have the full conversation, could you share it with us? He might have given some ideas/instructions on how we could do so. Wouldn't mind learning HLSL just for this, but I think @MACHIN3 also knows the language.

    this is what he said
    You could modify the engine to change that if you want in DeferredDecal.usf, FRCPassPostProcessDeferredDecals::Process() and UMaterial::IsPropertyActive().

    no idea how to do that.

  • Ingsoc75
    Offline / Send Message
    Ingsoc75 polycounter lvl 5
    Obscura recommended this technique for a project where I need to detail. 

    So let me get this straight and please correct me if I'm wrong.

    -I create a texture sheet of normal map shapes (in my case I would be using NDO)
    -I also make a mask sheet for the normal map sheet
    -In the 3D program (my case Maya), I create a bunch of plane meshes and align their UVs to the appropriate normal texture sheet
    -I then place the plane meshes on top of the model I want detail on

    In the game Engine (my case Unity) I would create a material just for the decals and assign then to the plane meshes.

    Is this correct?
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Almost. To get the normal map details correctly shading on top of the underlaying geometry, you will need a specific shader. You can find the required Unity shader somewhere in this thread. Other than this, yes, correct.
  • Ingsoc75
    Offline / Send Message
    Ingsoc75 polycounter lvl 5
    I did a search and did not find a particular Unity shader mentioned. Is this what you are referring to?
  • bac9-flcl
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    Yup. Here is my old repository:
    https://bitbucket.org/bac9/shading/overview

    Just found another one based on it, from Decal Machine developer:
    https://github.com/machin3io/MACHIN3shaders
  • Ingsoc75
    Offline / Send Message
    Ingsoc75 polycounter lvl 5
    We are using Unity 2017.2. Would these be compatible?
  • bac9-flcl
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    I don't see why they won't be, nobody would deprecate the methods used to make them work (finalgbuffer shader function etc.). They are not actively supported, but they should work fine. Besides, Unity has auto-updater for shaders, so even stuff like changing function names is handled for you the moment you import it.
  • Twinflower
    Offline / Send Message
    Twinflower vertex
    Ok, so is the tri-planar projection rig for the purpose of propagating only normals down to the 'base texture' of the underlying mesh then? Sorry if thats a dumb question, like I said its easy for me to get lost when stuff gets too technical :P
  • bac9-flcl
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    Not sure what rig you're referring to, deferred decals typically don't use any triplanar mapping.
  • mrgesy
    Offline / Send Message
    mrgesy polycounter lvl 7
    I wanted to do a project using this method in UE4 but a bit discouraged after reading through. So if I understand well, the limitations of this method include the inability to affect metalness and difficulties with POM/AO and albedo? Does Unreal 4.18 bring any improvements to this method? I'd really love to practice this workflow but want a complete pipeline and don't want to resort to hacks and tricks to get stuff to work. 
  • Prime8
    Offline / Send Message
    Prime8 interpolator
    mrgesy said:
    I wanted to do a project using this method in UE4 but a bit discouraged after reading through. So if I understand well, the limitations of this method include the inability to affect metalness and difficulties with POM/AO and albedo? Does Unreal 4.18 bring any improvements to this method? I'd really love to practice this workflow but want a complete pipeline and don't want to resort to hacks and tricks to get stuff to work. 
    Still has the same limitation, only albedo, roughness and normal can be overwritten but not blended, except by lowering the overall opacity.
    As mentioned somewhere earlier, the guys from Impeller have something working, but to which extend and what exactly, I don't know.
    http://polycount.com/discussion/comment/2566330#Comment_2566330

  • Menchen
    Offline / Send Message
    Menchen polycounter lvl 3
    Found this article which explains how to write custom shader code for unreal. It has 6 parts by now, including one explaining how to create a new shading model. Maybe we can adapt some of bac9's or @MACHIN3 's shaders for unity, and adapt them for unreal.

    https://medium.com/@lordned/unreal-engine-4-rendering-overview-part-1-c47f2da65346

    Would try to do it on my own if it wasn't because my desktop fucked up and I'm stuck to a laptop in which I can't even install unreal.
  • Jsummers
    Offline / Send Message
    Jsummers node
    Hey I'm still abit confused on how to do this in maya, can someone please post slightly more detailed instructions specific to maya? thanks
  • Johnnynapalmsc
    Offline / Send Message
    Johnnynapalmsc interpolator
    Does anyone know if this technique is now viable by using Deffered Decals in UE4? What is the current workflow using this technique? I'm also a bit lost as some people seem to say that they are using alpha maps for opacity and some are using another method, are both of them equally viable? The only way I personally got it to work is by using decals with alpha mask:

    As you can see no mask leaves bad normal map around the decal, is there no way around this? I am using some of the textures that were provided in this topic as a test

    This obviously work quite nicely, but I wouldn't be able to apply any other colour or material for example if I had screws. I would have to make a separate atlas for things with materials on them and things with only normal maps.
  • Johnnynapalmsc
    Offline / Send Message
    Johnnynapalmsc interpolator
    After reading this thread a bit more, I am guessing that at the moment in UE4 if I want to have a for example screw decal that has its own colour but around it it blends to the underlying material
    jusf using normal map, I would have to use a layered material or create two planes for the decals, one just for the normal map and one for the coloured screw? Or use the projection/stamp method within 3ds max to get the correct blend with underlying material? Apologies if I am overlooking something
  • andrad
    Offline / Send Message
    andrad polycounter lvl 5
    To whom it may concern:

    I implemented metalness for Unreal Engine dbuffer decals. It's something that people have wanted for a couple of years now and I'm not finished with all I have planned, but once I'm done, we should have a better workflow for the stuff that's discussed here.

    Since this is UE-specific, I'll direct you to the forums over there instead of spamming this thread. Here is the thread that I started about two years ago, I'm planning on documenting my progress there as well: Unreal Engine Forums.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    @andrad Great work. Impressive that you've been at this for 2 years and actually figured it out. :) It would be great if you posted a thread here on PC as well. I find the unrealforums to be a bit half-arsed a lot of the time. I'm sure if you posted here you would get possibly get more feedback and certainly users who will test out your process. I know I would. I'd like to hear what @obscura has to say about this.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    @Johnnynapalmsc the other options is to use a 2 UV channel set up and trim/decal sheet instead of mesh decals.
  • PolyHertz
    Offline / Send Message
    PolyHertz polycount lvl 666
    That's great news @andrad !
    Will it be possible to get it incorporated into official builds at some point? I'm not sure how open Epic is to incorporating user changes.
  • andrad
    Offline / Send Message
    andrad polycounter lvl 5
    @musashidan Don't worry, I've only been working on this for a week. It was two years ago that I asked Epic whether they would implement it themselves any time soon. Well, we know how that turned out. I'll try to see if I can cross post my findings here and on the UE forums, but you are definitely right - the forum over there is some wonky piece of software.

    @PolyHertz Might be, although that depends on how clean my code will be once I'm done with everything. Epic is generally very open to user contributions, as every Engine update usually contains well over 100 of them. But there is still some work to do before this is even worth considering.
  • frmdbl
    Offline / Send Message
    frmdbl polycounter
    @andrad

    I'd love to check it out, but I can't seem to be able to access the Github source.
  • andrad
    Offline / Send Message
    andrad polycounter lvl 5
    @frmdbl Are you working with Unreal Engine and have you linked your Github account to Epic's? These are the prerequisites of access to UE source code and all forks of it.
  • frmdbl
    Offline / Send Message
    frmdbl polycounter
    @andrad

    I think so, I've accessed the regular UE4 sources many times and I can access them now.
    What am I missing?
  • andrad
    Offline / Send Message
    andrad polycounter lvl 5
    @frmdbl Huh, maybe I'm doing something wrong. It's the first time I'm sharing a fork, so maybe I have to check some settings option or something. I have a look at it.

    In the meantime, I've created a post about it on Polycount and plan on keeping it updated as I make progress. Topic's here: https://polycount.com/discussion/202328/expanding-dbuffer-decals

    EDIT: I did indeed do something wrong, had to do with Github organizations and stuff. Is fixed now and the repository is up and running.
  • Johnnynapalmsc
    Offline / Send Message
    Johnnynapalmsc interpolator
    @Johnnynapalmsc the other options is to use a 2 UV channel set up and trim/decal sheet instead of mesh decals.
    When you say to use 2nd UV channel, do you simply mean having multi sub material within the same object? But in this case the materials wouldn't line up unless I'm missing something? For example I cut out a polygon where I want a screw to go, that obviously wouldn't work because of the surrounding around the screw? And this would require alpha blending anyway for anything that's not rectangular. Sorry if I'm missing out on something, I'm coming from mostly character modeling/texturing background. :D At the moment I'm using floating planes with decals mapped to them. I separated the materials for decals that only change normal maps and the decals that change more than just normal maps, and it seems to be doing the job, but it does limit some artistic freedoms.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    @JohnnynapalmscThe first UV channel will be your uniquely layed out UVs on your trim/decal sheet texture. Then you simply add uvw boxmapping on your second UV channel for your tiling texture. This will automatically blend in UE when you set up your shader using 2 channels.
  • Johnnynapalmsc
    Offline / Send Message
    Johnnynapalmsc interpolator
    @JohnnynapalmscThe first UV channel will be your uniquely layed out UVs on your trim/decal sheet texture. Then you simply add uvw boxmapping on your second UV channel for your tiling texture. This will automatically blend in UE when you set up your shader using 2 channels.
    Thanks so much man, finally wrapped my head around this. So basically the biggest downside here I guess, is the fact that you have cut inside of the mesh and this way place the decals, so it's not as flexible to move them around as it would be with floating planes? I won't switch over to this technique, but I'll definitely use in conjunction with others :)
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    @Johnnynapalmsc No problem, mate. Yes, that's the limitation with this method. It can get geo-heavy, especially if you are using edge trims. And obviously there's a bit of messing about with UVs. But you can still use floating geo and have it attached to the 'parent mesh'. That way you are sort of using a hybrid approach between this and the mesh decals.
  • Doomtrousers
    hey guys im a second year game art student, ive been using the fwvn 2uv lofted decal setup for a project im working on and its great
    i have heard from a few different places that the star citizen bois have been using parallax occlusion on the decals to get them to pop more
    im using UE4, and i can get POM working by itself easy enough, but when using it in the 2uv workflow i have trouble assigning it to the right uv channels
    i had been using uv0 for the main object and uv1 for the decals and couldnt get pom to apply to the decal only, so i tried again with the uv channels swapped and it still wouldnt apply pom properly

    anyone able to help me out with some material logic?
    thanks!
  • Forest_Cat
    Offline / Send Message
    Forest_Cat polycounter lvl 6
    My humble attempt to replicate Star Citizen workflow. Used Blender with a plug-in decalmachine.
    https://www.artstation.com/artwork/ElzNn

    model


  • Udjani
    Offline / Send Message
    Udjani interpolator
    Hey, i have a question about the decals in eu4, is it possible to make a decal that will project the entire normal map but the roughness and color just in some parts? i read in earlier comments here that you couldn't do that but the decal system changed quite a lot.

    Like in this example, i want to project the hole normal but roughness and color only from the blue part.


  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Hey. That's still isn't possible with the stock version. However, this guy made an extended implementation and he included masking option for all of the passes:
    https://polycount.com/discussion/202328/expanding-dbuffer-decals/p1
  • akaChris
    Offline / Send Message
    akaChris polycounter lvl 6
    I suggest making a comment/request about it here: https://github.com/EpicGames/UnrealEngine/pull/5463  It`s the only way Epic will know there is a demand for it (technically they are too much locked in with Fortnite and working towards their aspirations with raytracing to care much about real world problems like decals ;))

  • jameschaselight
    Offline / Send Message
    jameschaselight polycounter lvl 4
    I've stayed away from this workflow for a long time for just this reason. Most of what I see out there is a look that is too clean for my taste. I've gotten some good results using a second UV channel rather than decals. This allows for all material blends and even custom grunge on floating details, but it's a little more complicated. On the upside, It's cheap on the draw calls and works with Unreal (also Blender, Maya, 3DS Max).

    The render below is from blender 2.8 you can see more of this scene in my portfolio.


  • Naming_Convention
    Is there any way to implement this feature in the Unity shader graph?
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Only in a basic way.
  • apollo580
    Offline / Send Message
    apollo580 polycounter lvl 9
    This might be late but can I just get a quick confirmation if these are the steps used to model/texture these large ships and that its still valid today:

    - Create modular parts as needed
    - Add more polygon details onto parts that need it creating a "mid level polygon" count object
    - Create tiling materials for the parts (From substance designer for example)
    - Create a trim sheet that will be used for material blending
    - On the medium level object, creating flowing planes that will use the trim sheet and place those above the areas you want
    - Assemble everything in your engine of choice

    Is what I described correct?

    Edit:

    I tried out the Millenia approach and got a good/bad result. So I modeled some high detail shapes and baked them onto a plane, a circle and a long thin panel line. In the high poly you can see the panel line:

    Then in unreal I followed the Millenia tutorial of the material setup in unreal engine. I basically have a base material and my decal material shown below:

    Then I exported my low/mid poly model which has two parts, the main mesh and the decals placed on top:
    Finally in unreal engine I set element 0 as my base material and element 1 as my decal material to get these two results:
    The first image is just using the normal projection and the second is normal, colour, metal, and roughness. Overall Im happy with the circle being projected but the panel line doesnt seem to have enough depth to it. Is that a baking issue? Or is it because my decal plane is wider then the actual normal detail on the normal map?

    And lastly, with this method I would go ahead and create a mid-level model (ship in my case) with various parts that use different materials. Then I would add the decals on top to get the star citizen high detail look. My last question is if i can use a base material with some trim sheet parts and decals on top?







  • icegodofhungary
    Offline / Send Message
    icegodofhungary interpolator
    This is just for someone like me who might stumble upon this in the future. I was having an issue in Unreal 4 where my floating decals were too light in the shadow and too dark in the light.  This issue caused me to give up on this method for the past year. So I was messing around tonight, determined to figure it out. Unreal was applying the wrong settings to my normal map when I imported it. Whatever automatic settings it used needed to be changed.

    1) Double click your normal map, in the 'Details' menu, change the 'Compression Settings' option. I had to switch it from Default to Normalmap.
    2) Uncheck sRGB
    3) Inside your material for the decal, click on the Texture Sample node for the normal. Change the Sampler Type to 'Normal'.

    I have been trying to solve this for a year. I've watched all the videos I could find, read this thread a bunch of times. Read the Unreal 4 documentation. Searched this forum for all threads on the matter. It seemed nobody else had this problem. I know Unreal sometimes has issues with sRGB things if I don't import my color maps as 8-bit. So I just decided to uncheck it and see what happened. It threw an error of course. So I started changing stuff in order to get the error message to go away, while keeping sRGB unchecked. That series of settings described above worked.

    I finally get to start using this technique now and I'm pretty excited about it.
123457
Sign In or Register to comment.