X-Ray Shader

Hi.

Added a simple X-Ray shader to the Unify wiki: http://www.unifycommunity.com/wiki/index.php?title=XRay

Looks like this:

enjoy :slight_smile:

Tasty! Thanks for sharing this with everyone, it might come in handy for me right now actually. It’s a really nice effect.

Very cool, thanks!

Yay for Patrik! Was the process of writing the shader painful or not? :slight_smile:

nice one!

That looks really nice, thanks!

Glad you all liked it.

Not painful at all, very rewarding to see it work actually. It has definitely given me the taste for more :slight_smile: Hope to post some more shaders in the future as I learn more about ShaderLab Cg.

/P

That’s really nice!

As a bonus, it does other interesting things if you give it a texture which isn’t a gradient. :wink:

Yeah, playing around with the gradient (or putting in entirely weird textures) gets you some neat effects like pseudo reflections, anisotropic looks, and phosphorescent exoskeletons (like deep ocean creatures). Really cool. It’s inspiring to see shaders like this that respond in such interesting ways depending on it’s orientation to the camera.

Realy nice.
i am not a coder, but would it
be possible to use some of the code
to create a dirt shader.

Norby

This is what i mean

Norby

25361--911--$picture_1_197.png

Dirt shader I guess is the same as ā€œambient occlusionā€. Which is (I think) impossible to do in shaders alone, because for each point you have to actually compute how much it is occluded.

Most people just compute AO as some kind of offline process, bake it into the texture (or vertex colors) and just use that. Computing AO is not much different than computing lightmaps with a lot of shadow casting lights placed all around your scene.

Thanks Aras for clarifying this for me.

Norby

I’ve got an interesting issue with this shader. I’m using Radeon 9200, and if I use the shader in a project and build it, I don’t see the xray effect. However, if I run a build that someone else has compiled, I do see the effect. Any solutions/workarounds from the shader author or OTEE?

Does this shader require pixel shaders 2.0 on the video card?

Are you setting up a good ramp texture?

The shader only requires vertex shaders (R9200 can do that), and no fragment programs at all.

The ramp texture should be fine, as it is displaying a-ok for my team members. this is what I’m seeing:

I dont see any thing when using this shader im on a 9200 as well.

This is totally strange… When I view the BotBuilder beta this shader problem gets fixed. The BotBuilder beta is here: http://starmanta.googlepages.com/BotBuilder.html

This has happened to me twice now, and I think it is a bug in Unity…

I open Unity and I see a screwed-up sphere as pictured above. I leave the project open, view the BotBuilder beta, switch back to my project, and my sphere is rendered correctly.

Sam, that is seriously screwy! Can anyone else verify this odd behavior on their own computer (and if so what GFX card). We want to use this shader for our 3DU entry, but not if it doesn’t work on a number of people’s computers.

Not sure if it makes any difference, but you can remove the line ā€˜Lighting On’, it doesn’t do anything in this shader anyway.

Otherwise I don’t have a clue, I’m still learning about shaders myself.

Hope it helps.

/Patrik