Decal technique from Star Citizen

12346

Replies

  • Millenia
    Offline / Send Message
    Millenia Polycount Sponsor
    Obscura said:
    A technique that is accessible and usable in a proper way, for almost noone still lol. In Unreal , they made it possible to slap the decal material on meshes, but it still can't "overlay" and you need to hack with the opacity and normal intensity. color blending with an another mask also not possible so if I would do something like this, I'd probably still stay with one of the older approaches, probably the uv projection one. Because I would have so much better control over how things gets blended.

    Lets hope that developers will notice the need and we will get better support in the future.
    Yeah the dbuffer decals have promise but they need more work before they're ready to be actually used in production. I'm currently using a solution that involves having half of my texture sheet as a tiling section and the other half containing details for that material, and using vertex colour to mask and tint areas of that material for cheap variation. Still allows me to place normal map cards on top of the surface but it isn't quite as flexible a solution.
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 7
    Great information! I would have question how to approach welds in perpendicular areas using decals. I'm struggling with proper normals for them. I'm using UE4 DBuffer decal material with alpha masked normal only but my main issue with his technique is how to handle decal creation when areas I try to cover are welds on steel beams, pipe to pipe welds etc. Noticed that 3Ds Max Explicit Normals post in this thread but I need to experiment more with it. 
    In general how should I proceed with creation of this Dbuffer Decals meshes? Should I just use extra edge loops to define decal geometry, detach that and after obtaining L shape strip  average that edge normal where surfaces met? Texture and shader for it is all right, what I'm strugling with is good workflow to create this decal areas. 
    I'm not even sure if I should use chamferred planes (flat decal strip) or L shaped strips to produce convincing shading for welds.
    I'll try to post some images soon as I have pretty large numbers of assets that need this. For main shader I use world aligned tiling material. That one I might rework to object aligned, decide later, so far main material is working good but decal mesh normals drive me crazy, tested various normal thieves but none of them produced good result so far. 
  • Obscura
    Online / Send Message
    Obscura greentooth
    Hi. You could use the beveled/angled one in combination with face weighted normals. In my opinion, that should work just fine. In the mask texture, you would have the center area as fully blended (white alpha)  and it would quickly loose opacity after the outline of the welding.
  • Obscura
    Online / Send Message
    Obscura greentooth
    Yep, here is a quick one.

    The L shaped "sopport loop" kind should work too.


    Opacity map:

  • Obscura
  • Crimzan
    Offline / Send Message
    Crimzan polycounter lvl 3
    Thanks everybody for the info!
    The technique for the weldings really seems to be useful, I'd love to try that out soon too.

    So, what I understand from your answers, blending only normals of the decals that are slightly levitating above the mesh is not possible in the CryEngine with basic materials (I'm no coder)?

    Also, in the new CryEngine 5, how are alpha channels used for decals? My diffuse does have an alpha channel, but it isn't transparent at all - if I use alpha test, it works, but introduces hard edges. If it's not possible to actually blend normals only, I'd be happy if it was possible to actually go ahead and at least use a smooth alpha for it. But this might be something I can figure out on my own. Basically I'd just go ahead and use decals in general and have to live with the fact that the decals floating above my mesh simple don't blend with the underlying background.

    Excuse me if I ask some questions multiple times, but this decal-stuff is new to me. Have to Google things like deferred or something like this to even partially understand what's going on.
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 7

    Obscura said:
    Thank you for examples @Obscura ! What I'm having trouble is figuring out how to effectively produce this decal geometry as in my case welds are non repeating type for many assets I need to process. Above is just quick test with googled textures (need to make proper ones for best result). As you can see there are various "around" welds. I'm using 2 material ID's on that mesh, 0 being main and 1 is DBuffer translucent decal. 

    In above images you can see I have color blend via direction normal parameter (slightly colored top parts of mesh). Trouble with this setup is that as ou notice this kind of material does not want to work with decal technique. Looks like decal is rendered after main material and thus that weird coloring where meshes met. I could partially solve that by doing beveled edges where meshes met but my main aim with this technique is to have high fidelity up close, no need for unwrapping all that beam madness and for subsequent LODs just delete that decal part of mesh to avoid MANY subpixel triangles.
    As an solution to that blending issue I might need to make blending not only normal in decal but same color as in main material (might make material function for it) and control it through global shader parameter... That might end up working well as it would set same color and direction across all assets/instances using this data.
    I'll post here once I'll make it work (if it will work) :)
    FIY I'm still using UE4 4.14 need to recompile engine in next days... 
  • duke
    Offline / Send Message
    duke polycounter lvl 6
    The only pitfall of this technique that I can think of is automatic LOD generation not accounting for intersecting decals.
  • Crimzan
    Offline / Send Message
    Crimzan polycounter lvl 3
    You can always detach the decals first after auto-selecting them by material-ID and then create automatic LODs from the main mesh.

    I suppose that the conform brush with a specific offset in 3Ds Max will simplify the process of actually aligning the decals to the mesh. 
  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 7
    Crimzan said:
    You can always detach the decals first after auto-selecting them by material-ID and then create automatic LODs from the main mesh.

    I suppose that the conform brush with a specific offset in 3Ds Max will simplify the process of actually aligning the decals to the mesh. 
    I would need to look into that, is that part of PolyTools ribon?
  • Crimzan
    Offline / Send Message
    Crimzan polycounter lvl 3
    cupsster said:
    I would need to look into that, is that part of PolyTools ribon?
    It's in the Freeform section of the graphite modeling tools. Here's a little tutorial where he uses these tools to conform a ring onto a sphere (skip to about 04:45):


  • cupsster
    Offline / Send Message
    cupsster polycounter lvl 7
    Damn I barely visit that ribbon, need to learn it all now! That edge drag with snapping might be exactly what I need, to unwrap it is not problem as max have nice unroll by edge ring feature which is quick and effective, I was only scared of how could I quickly make that geometry in places where meshes intersect/touch without going crazy duplicating them, adding loops and deleting what I do not need. This puts things to new perspective, TY for providing such a nice example! I'm happy little camper now. :)
  • Crimzan
    Offline / Send Message
    Crimzan polycounter lvl 3
    The Graphite Modeling Tools have many interesting and useful features. It's definitely a great idea to check out all features that they provide!
    I'm glad it helped! :3
  • Toku
    Offline / Send Message
    Toku polycounter lvl 4
    Hey guys, I have read through the thread and it's good to see that you have made progress with a decal technique which can be used in UE4. From what I've gathered you can now use the DBuffer material on a static mesh which will write only normal/roughness information into the render pass and gives realistic results.

    The problem I have encountered is when trying to make a decal which is comprised of different materials. For example a plane which has a panel mapped to it where one side of the panel takes the material properties of the underlying surface (Modify Normal,AO) and the other side is made of another material (Modify Normal,AO,Albedo,Roughness,Metalic,Emissive etc).

    Using the DBuffer Translucent Color,Normal,Roughness material means that you can control those channels on the decal but if you want to mask out some of the channels in a certain area (so it passes through on one side of the panel and overwrites on the other) you would need an opacity control before it goes into the shader inputs! There it only one Opacity input which masks all the channels so that is not possible.

    I tried using Obscuras' method of using a reprojection of the surface material, which would effectively allow you to have "transparent" texture which you can then lerp new information ontop of with a mask, However the decal material domain does not support some of the shader nodes used. 

    N+R Overlay

    A+N+R Overlay (need to mask base color out)


    So I am pretty sure that's where the limitation is in UE4 for now, I am guessing Star Citizen has it's own shader which lets them mask out areas of each texture before putting it into the render buffer,, My main concern is using an AO channel on a decal as it either needs its own AO shader input or effect the surface below as being semi-transparent. 

    I think one solution is to make a decal which is blending just the normal channel for areas which need the form and not the material definition adjusting and then make a second decal which has an opacity mask around the edges of the first one which has all the material channels needed



    Here it's basically 2 planes cloned slightly offset on Z so the one with the metal panel is slightly above. The metal plane is a standard material with an opacity mask around the area where the material changes, Then the one below is a DBuffer material which is effecting only the normal channel to make the indent in the underlying surface. It is feasible to use a third plane which would have a semi-transparent material to overlay AO between the panels or some form of detailing which you want consistent across the surfaces (like dirt). But it is really expensive, multiple shaders, texture calles, samples and geo to achieve the end result when you could probably write a custom shader which could give the same end result, either way that is the best approach I've found so far..
  • DeathstrokeFTW
    Can anyone confirm that the decal method works well in UE4 4.15?
  • frmdbl
    Offline / Send Message
    frmdbl polycounter lvl 4
    Can anyone confirm that the decal method works well in UE4 4.15?
    Seems to be the case.

    @Obscura

    I might be missing something that's been already discussed, but 
    Is there there any reason why the decals couldn not be stacked so that you have a normal for a whole panel or a screw and
    a masked diffuse layer on top of it for just the edgewear?

    I tried this workflow, I have 2 decal material on top of each other, the shader complexity doesn't seem to be high.



  • Obscura
    Online / Send Message
    Obscura greentooth
    frmdbl said:

    @Obscura

    I might be missing something that's been already discussed, but 
    Is there there any reason why the decals couldn not be stacked so that you have a normal for a whole panel or a screw and
    a masked diffuse layer on top of it for just the edgewear?

    I tried this workflow, I have 2 decal material on top of each other, the shader complexity doesn't seem to be high.




    I guess you could do this. I ended up doing something similar once.
  • dpadam450
    Offline / Send Message
    dpadam450 polycounter lvl 5
    One of the things star citizen did was just put any geometric detail on top of things and you could choose if it replaced the GBuffers color/spec or just the normal.
12346
Sign In or Register to comment.