Clamp Greyscale Texture Min / Max

Node-based Shader Editor

Re: Clamp Greyscale Texture Min / Max

Postby jake.carvey » Thu Mar 08, 2018 11:44 pm

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
(133.4 KiB) Downloaded 202 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.93 KiB) Viewed 2429 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 (81.26 KiB) Viewed 2429 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
jake.carvey
 
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Postby sazberryftw » Fri Mar 09, 2018 11:27 am

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. :)
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Clamp Greyscale Texture Min / Max

Postby Amplify_Borba » Fri Mar 09, 2018 12:14 pm

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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Clamp Greyscale Texture Min / Max

Postby jake.carvey » Fri Mar 09, 2018 1:32 pm

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

Postby jake.carvey » Fri Mar 09, 2018 1:40 pm

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

Re: Clamp Greyscale Texture Min / Max

Postby jake.carvey » Fri Mar 09, 2018 2:03 pm

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 (147.32 KiB) Viewed 2418 times
jake.carvey
 
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Re: Clamp Greyscale Texture Min / Max

Postby sazberryftw » Fri Mar 09, 2018 3:30 pm

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!
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Clamp Greyscale Texture Min / Max

Postby jake.carvey » Fri Mar 09, 2018 5:29 pm

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!
jake.carvey
 
Posts: 16
Joined: Thu Feb 22, 2018 9:39 pm

Previous

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 86 guests