Hey all,
So does anyone know how you would go about making a shader similar to this for UDK
Where its an edge detection effect that shows every edge of a mesh and everything else inside the edges is transparent so you can have objects that are textured with single colors? Basically I just want to be able to turn on the wireframe of a mesh but also display the texture underneath.
The Sobel Edge Detection shader doesn't show every edge at all times and neither does Polycube's shader
http://polycube.blogspot.ca/2010/03/udk-edge-detection-shader.html
Replies
http://udn.epicgames.com/Three/DevelopmentKitGemsSobelEdgeDetection.html
It's simlar to the polycube linked one, but it might be a worth looking into because you can change the little things like edge contrast, thickness, depth control. Scroll near the bottom to see some variations it can achieve. Also, at the very bottom should be the .zip file so you can check it out.
But I dunno if that's what you're looking for, so maybe this link would be helpful. http://blog.environmentartist.com/?p=724
It talks about what your asking about, render a scene with wireframe.
Sorry I couldn't be more help, :P.
You can use the technique that Jeff is showing, but it will show your models triangulated, so your mileage may vary in that case.
Why not show off your wire-frames in your separate App like Max or Maya and use UDK for beauty shots only?
@James - That has the downside of requiring a really high resolution diffuse texture/material if you want to do that otherwise it looks really aliased.
@Butthair - Really? Butt hair? That's almost as bad as Ben Mathis' alias :P
Yeah I already mentioned Sobel Edge Detection in my fist post. Its not quite what I want. That video you linked me to though is actually the closest thing to what I want. Just really sucks that it will be triangulated geometry... doesn't look as clean. And it would be nice to be able to thicken the edges. I might just go with the baked wireframe. Was just hoping that you could do it with a shader because that way you don't have to have high resolution textures and a ton of unique islands in your UVs for high poly models.
@Ace - the above points are why this actually isn't the cheapest or easiest solution. Not to mention its more time consuming than a shader would be.
@Chris - thanks, you said in one sentence what Butthair's video link said in 5 mins :P
Is there not some way to tweak either the Sobel shader or Polycube's to make it detect every edge not just the outer ones? The screenshot above is actually my model inside p3D.in with shader set to shaderless and wire - http://p3d.in/14nNM/wireonshadeless
I guess there's no way to force the engine NOT to triangulate geometry is there? lol
For example, looking at this image, notice that its not even tracing completely around the character's hand. Any idea why this is or how I could increase it? I've tried adjusting the min/max distance and that didn't change anything.
The scene depth node looks to just be setting up the maximum depth, not a minimum.
to understand whats going on in there open up an image with an according zbuffer in photoshop
like this
http://www.ixbt.com/divideo/ae-plugins/3d.jpg
http://www.ixbt.com/divideo/ae-plugins/zbuffer.png
put the zbuffer on top, duplicate it, blur it by X pixels and set its layermode to difference, this is how the outline is created. you can multiply the result with your rendered image. If stuff fades away its basically just a lack of information in zbuffer
If I want the character to look fully outlined, I have to really lower the max distance and up the contrast but this makes the landscape look terrible.
The other way makes the character outline disappear completely though raising the contrast to 64 will bring it back, it still only goes to the hips and then introduces more artifacts on the landscape.
Is there a way to do the character and the environment in a separate pass?
back in the days when i did it for airborn it worked way better, besides i couldn't antialias it without gazillions of instructions, which made it look pretty bad. i never had such a result.
try this one, pretty sure you can instance it and control the edge highlighting if i remember correctly, its been a couple years.
basically the same thing with a few different calculations... again i cant remember and cba to look at the epic page right now
Are you okay with us using this for our game provided we give you credit of course?
Flat shaded, no transparency wireframe in the next unreal engine please epic
@Autocon - LOL I guess I'm not the first one to ask about this. Yeah the problem with the wireframe material is that you have to double all of your scene geo in order to get it to work. I was thinking it might look really cool to make a game with plain colors and wireframe, but its really no feasible if you have to do it via a material.
Now I'm just going with a cartoon look...
what do you guys think? Which do you think looks the best?
You mean to get the wireframe effect working? I'm lost on what exactly you're talking about.