Secondary color shader
Pack » Devlog
We wanted to have some color variation in our packlings to add some variety to enemies and maybe some customization for players, so I made a shader for that.
It takes in a secondary texture and uses it as a mask to decide where this secondary color will be applied, and does so while keeping the value of the main texture.
This is the subshader code to modify the albedo:
float4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; float mask = tex2D(_SecondaryColorMask, IN.uv_MainTex).a; float value = (c.r + c.g + c.b) / 3; c.rgb = c.rgb * (1-mask) + _SecondaryColor * mask * value; o.Albedo = c.rgb;
This is the mask for this particular model, I just took the main texture and edited it in gimp to erase certain areas and decrease the opacity of other.
Get Pack
Pack
Action RPG with creature collection mechanics.
Status | In development |
Author | FeitizoGames |
Genre | Role Playing |
Tags | 3D, Action RPG, Loot, Monsters, pokemon, Strategy RPG, Top-Down, Unity |
Languages | English |
More posts
- New creature! Volcark, the blacksmith hermit crabJun 20, 2024
- Creatures as charactersJun 03, 2024
- Dialogue systemJan 09, 2022
- All initial creatures are ready!Sep 29, 2020
- Gameplay polishingSep 20, 2020
- OverengineeringAug 22, 2020
- Controlling particles in unity with custom vertex streamsJul 22, 2020
- Gameplay video, new crafting systemJun 27, 2020
- Pack DEMO is now AVAILABLE!Feb 23, 2020
- Demo available on 23rd of February!Feb 08, 2020
Leave a comment
Log in with itch.io to leave a comment.