Generic Material For Procedural Workflow

UE4 Generic Material For Procedural & Modular Workflows
Current Version: 1.5.1

Generic shader for usage on mostly procedural & modular workflows.
Designed to demonstrate popular general processes and stages.
Almost every single varible has a bool so it only calculates what is used.
It has generic processes like intensity, contrast, opacity, saturation, tile, power, invert, min/max, hue… for almost every texture.
It also has generic features like rotating or panning textures randomly based on coordinate of objects or open/close emissive animations, unmirroring normals…
Just create an instance and enjoy…

Note: It doesnt work before 4.7.x versions.

General Features

Normal Map & Parallax Rotation

If you have any questions feel free to ask.
https://www.mediafire.com/?ju80q44qx1isfnb

INSTALLATION

Copy library folder into your Content folder
The path would be something like
C:\Users*User*\Documents\Unreal Projects*MyProject*\Content\Library

UPDATE

Back-up your project in case of any failure.
Dont save any custom assets into ‘Library’ folder structure including Material Instances.
Create a blank project and place the new Library folder there.
Delete the old Library folder from current project and transfer the new one by migrating ‘General’ material from your blank project.
All parameters will be transferred. But depending on update contents, some parameters may act different between the old and new versions. So follow change logs.

STAGES

All stages are independent. Essential stage is Color for standart materials and Emissive for unlit materials.
All textures are seperate for the sake of modularity.

Base: Parameters applied for all textures. Specific parameters override base parameters. (For ex; ColorUVRotation overrides and discards BaseUVRotation for Color layer)
Color (R or RGB): Simple and pure color values of base pixels without any external .
Occlusion.Base (R): Occlusion and/or cavity and/or micro shadow values caused by mesh. Used with 2nd UV channel. Second UV channel must contain the same UV info with the lightmap UV channel but can have much less padding between clusters to be more efficient.
Occlusion.Detail (R): Occlusion and/or cavity and/or micro shadow values caused by normal maps and/or parallax.
Layer.Base (RGBA): Simple and pure color values of layer pixels without any external . The alpha channel must have tranparency values that contains info on which parts of layer pixels will be applied top on Color pixels.
Layer.Filter (R): Color values of another alpha channel top on the current alpha channel within Layer.Base. It simulates the deformation on layer.
CubeMap.Base (RGB): Color values of standart cubemap texture.
CubeMap.Fake (R or RGB): Color values of a seamless texture applied all 6 different sides of a cube and acts like a cubemap.
CubeMap.Vector (RGB): Color values and/or parameters that affects the calculation and manipulation of CubeMap.Base and/or CubeMap.Fake.
CubeMap.Filter (R): Color values of transparency that contains info on which parts of pixels will be applied within CubeMap.Base and/or CubeMap.Fake.
Dirt (R): Color values of dirt corruption. Darker pixels are interpolated into dirt color while brighter pixels are interpolated into original values.
Washout (R): Color values of washout corruption. Brighter pixels are interpolated into washout color while darker pixels are interpolated into original values.
Emissive.Base (R): Color values of the input represents emissive behaviour on materials.
Emissive.Filter (R): Color values of transparency that contains info on which parts of pixels will be applied within Emissive.Base.
Emissive Animation: Parameters of simple on/off animation within Emissive.Base.
Metallic (R): Color values of the input represents metallic behaviour on materials.
Specular (R): Color values of the input represents specular behaviour on materials.
Roughness (R): Color values of the input represents roughness behaviour on materials.
Opacity.Base (R): Color values of the input represents opacity and/or opacity mask on translucent and/or masked materials.
Opacity.Fresnel: Parameters of fresnel effect within Opacity.Base.
Opacity.Refraction: Parameters of refraction effect within Opacity.Base.
Normal.Base (RG): Color values that represents a normal map that is on first stage.
Normal.DetailA (RG): Color values that represents a normal map that is on second stage.
Normal.DetailB (RG): Color values that represents a normal map that is on third stage.
Normal.DetailC (RG): Color values that represents a normal map that is on fourth stage. Used with 2nd UV channel. Second UV channel must contain the same UV info with the lightmap UV channel but can have much less padding between clusters to be more efficient.
Height (R): Color values applies for iterative parallax algorithm.

SOME GENERAL PROCESSES

Contrast: Cheap contrast based on gray interpolation.
Intensity: Set overal brightness.
Invert_1: Invert before manipulation.
Invert_2: Invert after manipulation.
Min/Max: Clamp values to min/max before manipulation.
MipLevel: Set constant MipMap Level.
Opacity_1: Interpolate values to OpacityColor. Can be overloaded to get cheap power effect.
Opacity_2: Second opacity channel in case of overloaded opacity_1.
Power: Increase/decrease strenght and adjacent affection of dark pixels.
UV3rd: Uses channel 3 instead of default 0 for custom situations.
UVOffset: Pan UV coordinates.
UVRotation: Rotate UV coordinates.
UVTile: Tile UV coordinates.
Gradient: Interpolate grayscale values to color.

Boost: Same with intensity but without clamping and applied at the end of manipulation. (Only for Emissive and Specular).

NormalIntensity: Set NormalMap RG contrast.
NormalUnMirror: UnMirror/Mirror tiling NormalMap.

Hue: Change hue angle on color values.
Desaturation: Saturate or desaturate on color values.

Random: Parameter will be assigned based on coordianate of object.

Hey thanks for sharing ! :slight_smile:

I can’t see the video though, says it is marked as private.

Well sorry, It was late night and I didnt realize that.

No problem, that video was worth the wait! Looks like an awesome material :slight_smile:

Which version of the editor did you use to create these assets? I tried adding them to my project yesterday and it ended up not showing in the content browser, and caused some kind of bug where the ram usage was going up by 1gb every 5 seconds until it ran out and crashed.

To be clear isn’t your fault! I am likely trying to use the assets in the wrong engine version, or placing them in the wrong location. Can you confirm that for me, I’m using version 4.6.1.

Thanks man! :smiley:

OP says it doesnt work on 4.6.x versions :(. Can you try it in 4.5.1? or maybe 4.7.0 Preview?

Aha! I knew I was missing something… Thanks man, will do! :slight_smile:

@caner_ozdemir:

Do you know if has already been reported on AnswerHub? I was going to post a bug report but if there is one up already could you let us know? Thanks!

No problem mate. If it works on 4.5.1 can you please post it here? Am still on 4.5.1 :slight_smile:

Hmmm… Actually it doesn’t work on 4.5.1 either. Loading the engine with the assets in the content folder makes my RAM usage shoot up and then crash just like 4.6.1. Really strange… :confused:

I created it with 4.7.0 Preview 1.
I actually didnt try if it works with 4.5.1.
I had already tried with 4.7.0 Preview 1 on different projects and it works.
The bug on earlier versions is about static bool variables and switches within material functions.
Just let me know if you cant get it work with 4.7.0 Preview 1.

Note: You have to copy library folder into your Content folder, not anything inside or outside Content Folder.
The path would be something like
C:\Users*User*\Documents\Unreal Projects*MyProject*\Content\Library

The paths are coded inside uasset files so we cant change folders of packages without editor which we was able to do in UDK.

Edit_1: I tried and confirmed it doesnt work with 4.5.1 either.
It happened just like you told, ram went crazy and crashed.
Thanks for the info.

Edit_2: I tried to recreate material functions that has switches but it is more than that.
It seems uasset files does not have to compability with older versions even when everything is same and none of new features have been used.
Just created an asset in 4.5.1 and converted in 4.7 then with no change converted again 4.5.1 and same crash happened.
It doesnt happen for all assets, complex assets are inclined to be affected more.

Just tested using version 4.7 preview 1 and it works perfectly, no issues whatsoever. So it is only older versions.

Thanks for the info on , I will put together a bug report today for Epic to look into when they get back. It is a very strange, never seen anything like it before…

Thank you! :slight_smile:

Thanks for the info both you. Unfortunately am still on 4.5.1 and am planning to update to 4.7 release version. Then i’ll download material and give it a try. Thanks caner_ozdemir for the Material. It looks nice. :slight_smile:

Thanks Ryan, it makes me proud a veteran like you enjoys my stuff. :slight_smile:
I have been using it almost 2 months, I didnt release it to make it mature.
I made a new version and added uv panning, rotating, min/max values for every texture.
I want to also add simple cloth/ocean animations later on.

So one more little update.

It has now two invert values, invert_1 inverts the image before manipulation, invert 2 does it after manipulation.
It also has two opacity values, you may overload opacity_1 to get different aspect of results and if you still need an opacity, there is an opacity_2.
Now every image has opacitycolor value.
There is also little bit update on emissive animation, you can offset starting time of animation.

You have tons of combination to get the result you want.
It is all up to your imagination.

Thanks for sharing , Caner. :slight_smile: Like Satheesh I’ll have to wait for 4.7 release to check it out though.

Thanks a lot. Really helpfull to me.

Alright a major update here.
I decided to make some changes with hierarchy of shader.
Here is an example how it works.

BaseUVOffset, makes an offset on UV’s of textures assigned.
If you check BaseUVOffsetRandom, your value will be discarded and will be assigned automatically based on coordinate of object.
If you check same property for spesific layer like ColorUVOffset, BaseUVOffset and BaseUVOffsetRandom will be discarded for only Color layer.
It will be exactly same for parameters like BaseUVRotation, BaseUVRotationRandom, DirtUVRotation.
hierarchy also saved a few instructions.

Rotation of normal maps and parallax has been fixed thanks to mAlkAv!An.
Iteration parameter has been added to the parallax.

I know some processes like rotating parallax and normal maps are expensive.
So I dont mostly recommend you doing expensive calculations but with shader you can quickly try most of stuff that you are able to and if you like the combination you can just leave and apply them in an image manipulation program like Photoshop.
But other than that, most calculations are cheap.

A minor update.
Fixed clamping intensity values on emissive.
Fixed occlusionbase affect on translucency. Now it affects opacity instead diffuse on translucency mode.

Another minor update.
Fixed issues with 2nd and 3rd UV channels.
Now every layer has 3rd UV channel option.

hey man, i had the to try out your shader today. i like it pretty much! It would be nice, if you talk more about some inputs and parameters, how they work and what you need.
like an small overview, how to prepare correctly to use your shader. i know there are sometimes a lots of ways, to get to nearly the same results. So maybe a small list, witch textures,
stick to the specific slots in your shader.

its still at bit hard for me, to get behind your workflow. iam pretty sure its better than mine, so i would love to learn something more from you :slight_smile:

greetz