Page 1 of 1

XRay Shader: How was it created?

PostPosted: Mon Aug 06, 2018 12:44 pm
by AurochChris
Hey there,

I am a little unfamiliar with the higher skills of shader programming, so apologies if I am asking some very basic questions:

So, I've just updated ASE, and found the XRay sample. We're working on an XRay system in our game, and we're going to use the standard Unity route of using replacement shaders; however this looks like an interesting and easier solution.

However, because there's no documentation yet, I am left with some questions how this is implemented:

1) The vertex outline is only rendered when the Z value in the depth buffer is closer than the z of the fragment. However, I can't find any logic which actually tests this - is this a property of the outline function itself?

2) Would I be able to replicate this if I wanted to create something entirely custom? (For example, generate a color gradient for the mesh based on fragment height; and only show that on parts that are behind the current z buffer value.)

3) I was under the impression it wasn't possible to create multi-pass standard surface shaders yet. The .shader file contains multiple cg programs, but not passes. How exactly was this achieved?

My end goal is to take Unity's standard shader and a couple of our own custom ones, add new pass into it like the XRay sample but with our own visuals for about 8+ different shaders. If I can get through to that using ASE rather than hacking our tech artist's shader into existing .shader files that'd be amazing.

Thanks in advance!

Chris

Re: XRay Shader: How was it created?

PostPosted: Mon Aug 06, 2018 4:48 pm
by Amplify_Borba
Hello Chris, thank you for getting in touch and for your support!

I'll have to pass this topic to the developer as he can provide better insight regarding the X-Ray sample than I can, he'll get back to you as soon as possible, thank you for understanding!

Re: XRay Shader: How was it created?

PostPosted: Tue Aug 07, 2018 2:41 pm
by AurochChris
No worries, I understand!