Clamp Greyscale Texture Min / Max

Node-based Shader Editor
jake.carvey
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Post by jake.carvey »

Hi all - here is the recent stable version of the shader, works as far back as 5.6.3 afaik
JV_Damage-Cutout_0.91.zip
(132.89 KiB) Downloaded 950 times
Albedo texture should have some sort of damage texture in the alpha (ideally positioned to fit within the mask textures below)
jv_damage_params.JPG
jv_damage_params.JPG (104.66 KiB) Viewed 7398 times
Damage masks allow the damage textures to create the actual alpha cutouts, separately from one another, including the surrounding bloodstains.
jv_damage_grab.JPG
jv_damage_grab.JPG (80.99 KiB) Viewed 7398 times
Ïf using forward rendering, and linear color space, make sure the sRGB option for the MASK texture is "un-checked". (took us a few hours to track that one down when sharing projects...)

Planning to post a web demo shortly...

- jake
sazberryftw
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Clamp Greyscale Texture Min / Max

Post by sazberryftw »

jake.carvey wrote:Hi all - here is the recent stable version of the shader, works as far back as 5.6.3 afaik
JV_Damage-Cutout_0.91.zip
Hey! I had a look at your shader and looks cool. :) Did you know if you change your filter mode on your mask texture to "point" it will get rid of the nasty artifacts around your masks? I'm not sure of any performance implications of changing this option though.

Is the harsh pixel edges something you're going for stylisticly? The way I was using it in my shader it didn't matter as all the edges were in the padding of my UVs, but I guess in your case it was unavoidable. I'm not sure if there's maybe a way to blur the generated mask so that you can add in some sort of anti-aliasing? I was trying to work this out but didn't find anything.

Oh and you should upload your example in a Unity Package instead of just zipping the files up, this will ensure that options like disable sRGB persist when you share it. :)
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Clamp Greyscale Texture Min / Max

Post by Amplify_Borba »

jake.carvey wrote:Hi all - here is the recent stable version of the shader, works as far back as 5.6.3 afaik
JV_Damage-Cutout_0.91.zip
Albedo texture should have some sort of damage texture in the alpha (ideally positioned to fit within the mask textures below)
jv_damage_params.JPG
Damage masks allow the damage textures to create the actual alpha cutouts, separately from one another, including the surrounding bloodstains.
jv_damage_grab.JPG
Ïf using forward rendering, and linear color space, make sure the sRGB option for the MASK texture is "un-checked". (took us a few hours to track that one down when sharing projects...)

Planning to post a web demo shortly...

- jake
Thank you for sharing this cool effect, looking forward to the web demo!

sazberryftw wrote:Oh and you should upload your example in a Unity Package instead of just zipping the files up, this will ensure that options like disable sRGB persist when you share it. :)
Like sazberryftw said, it would be awesome if you could provide your sample in a unity package, keep up the good work!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
jake.carvey
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Post by jake.carvey »

Hey! I had a look at your shader and looks cool. :)
Thx! Was a lot of hours of troubleshooting and dev. Looks much cooler animating with full normal mapped textures, interior parallax "blood and guts" mesh, realtime shadows (!) etc. Just wanted to get something up in case anyone was still looking for options to do this.
Did you know if you change your filter mode on your mask texture to "point" it will get rid of the nasty artifacts around your masks? I'm not sure of any performance implications of changing this option though.
Yes - actually I mentioned this earlier in this thread (also disable mip-mapping). Also, it still needs some work in finding the ideal greyscale values to choose - will come up with an easier system for that.
Is the harsh pixel edges something you're going for stylisticly? The way I was using it in my shader it didn't matter as all the edges were in the padding of my UVs, but I guess in your case it was unavoidable. I'm not sure if there's maybe a way to blur the generated mask so that you can add in some sort of anti-aliasing? I was trying to work this out but didn't find anything.
The harsh edges (if I understand you properly) are because this MUST be a "Cutout" shader. The amount of NPCs the game will have on screen at one time completely prevents the use of Transparent shaders, at least that's the directive i received. Might be able to turn it into a multi-texturelayer instead for most of it, but that will have to be for another project.
Oh and you should upload your example in a Unity Package instead of just zipping the files up, this will ensure that options like disable sRGB persist when you share it.
Good call - I did that with earlier versions, but didn't have the time to spare troubleshooting the package, as it was very very late night / morning already here in Thailand! Also, the team I was working with seems to have an aversion to packaging things up portably, so I was always having to test and troubleshoot the manual workflow. Will send as package next time, and hopefully with some cooler examples - this one i needed to ensure the textures weren't from the assets themselves.
jake.carvey
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Post by jake.carvey »

JV_Damage-Cutout_0.91.unitypackage
Here's the package
(170.94 KiB) Downloaded 672 times
jake.carvey
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Post by jake.carvey »

Quick screenshot of the rough effect (always room for improvement, this is meant for medium sized crowds of NPCs). Damage colors and blood and guts are temp, not sure how the devs will proceed from here with that part. :)
zombie-tester-damage-clip.JPG
zombie-tester-damage-clip.JPG (146.9 KiB) Viewed 7387 times
sazberryftw
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Clamp Greyscale Texture Min / Max

Post by sazberryftw »

jake.carvey wrote: The harsh edges (if I understand you properly) are because this MUST be a "Cutout" shader. The amount of NPCs the game will have on screen at one time completely prevents the use of Transparent shaders, at least that's the directive i received. Might be able to turn it into a multi-texturelayer instead for most of it, but that will have to be for another project.
Ahh I guess I wasn't aware you were using transparency specifically. I was talking more about if you wanted to layer the blood onto the albedo on an opaque shader you would need some kind of fake anti-aliasing (like you could get if you made the mask manually in Photoshop) if you wanted to remove the harsh pixel edges.

But yeah seems like an awesome use for it!
jake.carvey
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Post by jake.carvey »

if you wanted to layer the blood onto the albedo on an opaque shader you would need some kind of fake anti-aliasing (like you could get if you made the mask manually in Photoshop) if you wanted to remove the harsh pixel edges.
Yeah - the final damage "splats" actually *are* full grayscale, and "grow" as we increase the damage parameter per "quadrant" - which actuallys makes a pretty cool animated effect in action!
Post Reply