Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[RELEASED] M3 e-HG (SciFi Hand Gun)

Discussion in 'Assets and Asset Store' started by MACHIN3, Nov 11, 2017.

  1. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54

    M3 e-HG (ScFi Hand Gun)

    The M3 e-HG is an energy pistol from MACHIN3 Weapon Manufacturing.

    Offering semi- and full automatic firing modes, the gun can be used in a variety of strategic and combat scenarios, making the gun a perfect all rounder.
    Extended with the supplied FLX-0 multi-spectrum flashlight you will be prepared perfectly for low visibility conditions.

    ---​




    This asset is quite detailed and created with an eye towards current and next-generation needs in the gaming and real-time film spaces.

    This asset is built using deferred mesh decals and REQUIRES deferred rendering. It will not work in forward rendering!




    PARTS

    The Asset comes in 2 main parts:
    • the pistol
    • the flashlight

    THEMES - MATERIALS - SHADERS

    8 Material themes are supplied via prefabs.
    Additional themes can be created easily by tweaking various parameters in real time and at runtime and by assigning materials to areas of the asset.

    Material Weathering is achieved using low-res tileable grunge maps, masked by medium resolution AO and Curvature bakes.

    Surface Shader
    • PBR, material color, roughness and metalness
    • built in Amplify Shader Editor (ASE)
    • grunge (roughness variations)
    • edge wear on decals and geometry and vertex color based
    • dirt on decals, geometry and vertex color based
    • custom inspector

    Decal Shader
    • PBR, decal subset color, roughness and metalness
    • decal AO
    • simple, curvature map based wear
    • optional PBR slots for finer control using textured decals
    • custom inspector

    Customization
    demonstrated using a shader ball






    The M3 e-HG is ~40cm in length.

    Polygon- and Object Count
    • Pistol: 8860 tris, 20 objects
    • Flashlight: 1788 tris, 5 objects

    Note, the polygon count includes the decal meshes, while the object count does not

    Textures
    • Gun: 3 x 1024px decal atlas textures, 1 x 512px surface mask
    • Flashlight: 2 x 512 + 1 x 256 decal atlas textures, 1 x 256px surface mask
    • 4 x 256px tileable grunge maps (reusable)
    • 9 x 128px tileable detail maps (reusable)
    • PNG format



    All images have been rendered in Unity3D using:
    • Post-processing Stack v1
    • Amplify Bloom











    The MACHIN3 listens.
     
    Last edited: Feb 19, 2018
    hopeful and theANMATOR2b like this.
  2. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,459
    Really quite impressive looking! I may have to get this just to enjoy it. :)
     
  4. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,003
    Ooops. VR and deferred rendering don't go well together, so if you rely on deferred rendering, I wouldn't mention VR because at the current point in time, deferred rendering simply isn't something anyone should do in VR.

    I have tried making it work with this decal system which does work with forward rendering - but it's a very different approach, so I'm afraid I'll have to go without the decals for now :-(

    Is there a way to add forward rendering support for the decals?
     
  5. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
    Hi Jashan, I've removed the VR mention. FWIW, I had already removed it from the product description, when I updated this asset to v 1.1 on January 31st. I really hope AA issues with deferred rendering can be resolved in the near future.

    How does the forward rendering support work in Dynamic Decals? Is it just alpha mapped decals?

    I could probably provide prefabs for using alpha mapped decals, which will work in forward rendering. This comes at the cost of occluding the surface material in places for the decals are opaque, so there's now "material blending" I'll investigate how well this work. It might still be a acceptable for some use cases.
     
  6. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
    This Asset was recently updated to version 1.1 here's the changelog.
    • ported Surface Shader to Amplify Shader Editor
    • the 3 previously separate surface shaders - plain, textured normal and textured full - are now a single M3_surface_textured shader
    • added custom inspector for M3_surface_textured shader
    • removed need for plain decal shader in favour of extended textured decal shader, which can now be used with empty color and metalness/smoothness maps
    • added custom inspectors for decal shaders
    • fixed info decal transparency blending issue on metallic materials
    • updated info decal shader to use opacity instead of transparency
    The key improvements are ASE support for the surface shader and custom inspectors for both - surface and decal shaders, making using the materials based on these shaders much simpler.
    Also, all surface materials now use the same shader, which has optional PBR texture slots.
    The previous "Material Customization via Decal and Surface Shaders" video is now outdated and was replaced with a new one:

     
    jashan likes this.
  7. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,003
    To be honest, I'm not sure. But I believe it's just textures projected on geometry.

    That would be great! At the moment, I have simply disabled all decals. The main issue with Dynamic Decals is that either the UV mapping is interpreted differently, or completely ignored. So to use that, I'd have to basically cut the texture atlases into separate parts and place each decal from scratch.

    Even if it doesn't work perfectly for all of the decals, it sounds like it would be quite an improvement to what I have now ;-)

    With "metal blending", you mean that some colors could not fully override the base color? Like, white text wouldn't work, or black text wouldn't work?
     
  8. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
    Yeah, I figure it would be a big improvement over not having decals at all, ha.

    What I mean, is what I'm demonstrating in the video at this position. I change the surface material, and parts of the decal outside their subsets, updates accordingly - the surface material blends trough, but decal normals are still used.



    This is rendered in Blender/Cylces, for demonstation. The left side is what a alpha mapped decal would look like, while deferred decals look like the ones on the right.

    Info(text) decals should work without problems or limitations as alpha mapped decals in forward rendering.
     
    jashan likes this.
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,003
    Ah, cool. So Deferred Decals can be "normal only" but alpha mapped decals can only be both, right? So once I'd have your forward decal shader, the info/text decals would already work as expected but those adding normals would also change the color.

    But, if I understand it correctly, I could then color the textures to fit the gun design to get the same or a similar effect as with deferred decals - just with more work and less flexibility (I couldn't easily change the color scheme, each color would require extra work on the textures). Correct?
     
  10. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
    Pretty much. Can you please get in touch via email? I want you to test the forward decals(alpha mapped), before I update the assets.



    You can actually make it work pretty well, but yes forward decals are fully opaque and their materials will not match the ones below.
     
    Last edited: Feb 22, 2018
    EvilGremlin and jashan like this.
  11. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,003
    That version with forward decals I'm now testing is working really well! I do need a few extra materials and in one case, couldn't make it perfect because I'd need two different materials where I only have one decal-object ... but this is really awesome and I'm very happy already ;-)
     
  12. massconfusion

    massconfusion

    Joined:
    Feb 15, 2018
    Posts:
    11
    Great weapon and shader customization. Is there a way to open the decal shader in amplify like the surface shader?
     
  13. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
    Hi @massconfusion,

    the decal shaders unfortunately can't be opened in ASE, they are hand written.
    The shaders write to the deferred buffer, which you can't be accessed in ASE, as far as I know.
     
  14. Silverwind_dragon

    Silverwind_dragon

    Joined:
    May 1, 2018
    Posts:
    2
    First of all, thanks for this awesome system. Really powerful and easy to use. It's finally possible to have impossibly huge models, yay!
    One question though - how are mask maps for surface shader packed? What goes in what channel? You mentioned that the mask is made up of medium resolution AO and curvature bakes, but how exactly are they packed?
     
    rysone likes this.
  15. rysone

    rysone

    Joined:
    Feb 17, 2017
    Posts:
    7
    I tried this from the documentation but still nothing.
    "If you are baking from highpoly only for edge highlights you can alternatively consider using chamfers and custom vertex normals as created by (W)Step, in wich case Transfer Sharps should be turned off as there won't be any hard edges in your low poly object."
     
  16. tnikolopoulos

    tnikolopoulos

    Joined:
    Jun 12, 2017
    Posts:
    1
    Hi great tools and workflow. Keep up the great work!
    I have also purchased Decal Machine and am trying to create my own assets.
    I assume that you can get the mask map by doing a DecalBakeDown but like Silverwind i am completely lost as to what goes where. Trying to read your shader it uses the channels like:
    tex2DNode76.r * _WearGeometry
    tex2DNode76.g * _WearDecals
    tex2DNode76.b * _AmbientOcclusion
    tex2DNode76.b * _DirtGeometry
    tex2DNode76.a * _DirtDecals
    so by the looks of it blue is AO of the geometry
    red is curvature of the geometry
    green is curvature of the decals
    and alpha is AO of the decals
    but the bake down seems to only generate Curvature and AO for the decals. How do we get the same for geometry?
    (btw in the future it would be really cool if DecalMachine could export the MaskMap directly! :) )
     
  17. Silverwind_dragon

    Silverwind_dragon

    Joined:
    May 1, 2018
    Posts:
    2
    I figured it out. The mask map is packed like this
    R - geometry wear (real geo edges) G - Decals wear (deferred decal edges) B - Geometry Dirt+AO A - decals dirt
    As for the baking - here's how I do it
    1. For geometry curvature map, I just import the lowpoly mesh into Substance painter and bake out the maps with "use Lowpoly as Highpoly" box checked. It give you a curvature map, but you should mess with it a bit and add grunge, edge damage etc. in painter. As a result I have a BnW texture for geometry edges, yay. You can paint the BnW map for Geo dirt here as well.
    2. Now, to bake the decals onto the main mesh, you'll nedd xnormal. It has a thingy called Base texture bake. Basically, you should load you lowpoly mesh with flat normal map (just flat normally color :)) and decals mesh with their normal map into highpoly section, then load lowpoly again into lowpoly section and in "maps to bake" section choose "bake base texture". Ta-da, you have decal normals projected onto main mesh normals (or lack thereof). Now that you have that normal map, make a curvature map out of it (with substance painter, knald or any other tool). There you have it. The same way can be used for decal dirt.
    3. Finally, just take all BnW maps you just made and pack them into relevant channels. And it's done.
    Hope it helps :)
     
  18. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    201
    @MACHIN3

    Will you make more weapons or are the ones you have now it? I also see you customized a shader ball. So can anything be textured the same way with this asset? I didn't quite catch how that works.

    Thanks for your time.
     
  19. MACHIN3

    MACHIN3

    Joined:
    May 25, 2016
    Posts:
    54
    I've been busy with tool building(MESHmachine), for the past 6 months (and if you include DECALmachine, the past 18 months).

    See
    and


    I'll get back to assets and Unity very soon, and will be doing nothing but assets for at least 6 months. I can't wait.
     
    jashan and EvilGremlin like this.
  20. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    201
    Okay, thanks. That is an impressive workflow.
     
  21. Bamfax

    Bamfax

    Joined:
    Jun 12, 2016
    Posts:
    24
    e-HG on forward. I got the e-HG back in July and just love it:

    SpacemanSpiff_now_has_a_new_shiny_gun.jpg
     
    EvilGremlin and hopeful like this.