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!
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
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?
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.
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:
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?
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.
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?
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
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.
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?
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.”
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! )
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
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.
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.
Finally, just take all BnW maps you just made and pack them into relevant channels. And it’s done.
Hope it helps
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.