Image Edge Detect Material Effect

41 replies [Last post]
User offline. Last seen 1 week 4 days ago.
Posts: 406

I'm going back through the Lighting & Post Processing DVD and I'm trying to recreate the image edge detect material. But I can't seem to get it to work. Is there something I'm missing?

User offline. Last seen 1 day 17 hours ago.
Administrator
Posts: 4182

Hmm.

The shader tree looks ok...

Just a few quick thing to check.

  • Check that you have the Material effect node in between the SceneRenderTarget node and the UberPostProcessEffect node in the Post Process Chain
  • Make sure the Material Blend mode is set to Translucent with the lighting Model set to MLM_Unlit

Let me know if that works Smiling

User offline. Last seen 1 day 18 min ago.
Posts: 230

Which Chain are you using? Because in newer versions of UDK you have to be using the _Console chain as that is the default. 

Check line 29 of your default engine ini for the default postprocess chain. 

User offline. Last seen 1 week 4 days ago.
Posts: 406

Ok, I put the effect the console chain but now it looks really messed up. Mr.Prout's material has 61 instructions while mine has over 100. I think I copied everything correctly but there's still something wrong.

post_process_chain.jpg imageedgedetect_shot01.jpg imageedgedetect_shot02.jpg
User offline. Last seen 1 week 4 days ago.
Posts: 406

now when I go back to the FX_Hieffect Material, I get this. WTF?

also here is the material editor for my image edge detect material.

hieffect_mat_wtf.jpg edgedetect_mat_editor.jpg
User offline. Last seen 1 week 4 days ago.
Posts: 406

metalliandy wrote:

Hmm.

The shader tree looks ok...

Just a few quick thing to check.

  • Check that you have the Material effect node in between the SceneRenderTarget node and the UberPostProcessEffect node in the Post Process Chain
  • Make sure the Material Blend mode is set to Translucent with the lighting Model set to MLM_Unlit

Let me know if that works Smiling

Do you know if Mr.Prout is on the forums?

User offline. Last seen 1 day 17 hours ago.
Administrator
Posts: 4182

Wow crazy :O

I would just pretend that you meant to do it like that...the image with the red around the edge looks awesome! Sticking out tongue

and yea, Dave is one the forums http://eat3d.com/users/daveprout :)

User offline. Last seen 1 week 4 days ago.
Posts: 406

metalliandy wrote:

Wow crazy :O

I would just pretend that you meant to do it like that...the image with the red around the edge looks awesome! Sticking out tongue

and yea, Dave is one the forums http://eat3d.com/users/daveprout :)

I haven't the slightest clue as to why the red thing shows up. I really want to get my material working though.

User offline. Last seen 1 week 4 days ago.
Posts: 406

Did Epic change the way Post Processing is enabled in the July UDK update? 

User offline. Last seen 1 week 4 days ago.
Posts: 406

Pop the Champagne everyone because I got it working and you won't believe what the problem was.

fixed_edgedetect_fx_mat02.jpg fixed_edgedetect_chain02.jpg fixed_edgedetect_screenshot_01.jpg fixed_edgedetect_screenshot_02.jpg fixed_edgedetect_screenshot_03.jpg
User offline. Last seen 1 week 4 days ago.
Posts: 406

Now all I need to do is figure out how to edit the material to my liking.

User offline. Last seen 1 day 17 hours ago.
Administrator
Posts: 4182

LOL!

Nice find mate...glad you got it sorted Laughing out loud

User offline. Last seen 1 week 4 days ago.
Posts: 406

metalliandy wrote:

LOL!

Nice find mate...glad you got it sorted Laughing out loud

do you know if there is a way to make the shader look more like a "painted surface"(if that make sense)?

User offline. Last seen 1 day 17 hours ago.
Administrator
Posts: 4182

IIRC on the lighting DVD there is a paint daubs effect that Dave goes through...or did you mean a more toon shader type look?

User offline. Last seen 1 week 4 days ago.
Posts: 406

metalliandy wrote:

IIRC on the lighting DVD there is a paint daubs effect that Dave goes through...or did you mean a more toon shader type look?

I'm using the paint daubs look right now, so yeah a more toon shader look. But I'm wondering if it's possible to have a brush stroke effect.

User offline. Last seen 1 week 4 days ago.
Posts: 406

I'm trying out the other material in the lighting DVD and I'm trying to figure out how to show the diffuse texture of a model while keeping the outlines. Basically a toon shader. I couldn't figure it out from the other material so maybe this one would be easier. 

I'm stating to realize that after watching multiple dvds on UDK materials, I still don't understand the math behind each node. I even went to Hourences website and I still fully understand.

toon_shader_mat01.jpg toon_shader_mat02.jpg toon_shader_screenshot_01.jpg
User offline. Last seen 1 day 17 hours ago.
Administrator
Posts: 4182
User offline. Last seen 1 week 4 days ago.
Posts: 406

metalliandy wrote:

Something like this?

http://www.polycount.com/forum/showthread.php?t=69086 :)

more like a combination between the Poster Shader and the Ink Shader. It seems like this shader on Polycount might help.

street-fighter-iv-shaders-a4.jpg
User offline. Last seen 1 week 4 days ago.
Posts: 406

I found this on Polycount and I'm wondering if I can turn it into a Post process material. the shader was created by Steffen Unger and it's based off the Team Fortress 2 Shader.

shader.jpg
User offline. Last seen 2 days 19 hours ago.
Administrator
Posts: 1390

I have been really enjoying this thread and want to contribute something. Dave made a few simple packaged to show some stuff off but it never made it into the dvd's project files. So I decided to them here free to the community. (Attached)

I only ask that you point people to this post to download the file, instead of re-distributing it.

AttachmentSize
eat3d_udk_lighting_materials.zip 7.35 KB

-Riki

User offline. Last seen 1 week 4 days ago.
Posts: 406

Riki wrote:

I have been really enjoying this thread and want to contribute something. Dave made a few simple packaged to show some stuff off but it never made it into the dvd's project files. So I decided to them here free to the community. (Attached)

I only ask that you point people to this post to download the file, instead of re-distributing it.

Thanks a bunch Riki. 

I "think" I almost have the Team Fortress 2 shader working. This would be so much easier if I actually know what I was doing.

tf2_shader_screenshot_01.jpg
User offline. Last seen 1 week 4 days ago.
Posts: 406

Pop the Champagne again everyone, I think I got it working. If anyone here would like the file to check and see if I'm doing right let me know. I'm really hoping I got this right. I don't really have any good assets to test this on; if anyone wants to lend me one and see if it's actually working.

tf2_shader_screenshot_02.jpg tf2_shader_screenshot_03.jpg
User offline. Last seen 37 weeks 7 hours ago.
Posts: 147

hey kaze. the tf2 shader from steffen works out really well. i used it as a test for a small project i was working on. The postprocess outline i came up with after watching the lighting dvd, in combination with the tf2 shading gives a really nice result.

with the tf2 shader the maps need to be pretty precise mostly in the specular sections.. as well as the gradient ramp.. that pretty much controls the entire thing. for that i dont really think i changed too much from the original in the above pic, keeping in mind that the maps should have some sort of a hard-shaded texture (which mine currently lacks.).. but ill go back and check my material. the post process material i have is posted here.

 

http://eat3d.com/forum/dvd-reviews/oniram-udk-lighting-and-post-processing-review

User offline. Last seen 1 week 4 days ago.
Posts: 406

Oniram wrote:

hey kaze. the tf2 shader from steffen works out really well. i used it as a test for a small project i was working on. The postprocess outline i came up with after watching the lighting dvd, in combination with the tf2 shading gives a really nice result.

with the tf2 shader the maps need to be pretty precise mostly in the specular sections.. as well as the gradient ramp.. that pretty much controls the entire thing. for that i dont really think i changed too much from the original in the above pic, keeping in mind that the maps should have some sort of a hard-shaded texture (which mine currently lacks.).. but ill go back and check my material. the post process material i have is posted here.

 

http://eat3d.com/forum/dvd-reviews/oniram-udk-lighting-and-post-processing-review

did you put the TF2 shader in the Post Process material node or is it on each object. I'm not exactly sure if what I did is correct.

User offline. Last seen 37 weeks 7 hours ago.
Posts: 147

no. i created one "Master Material" and just created instances from which i could swap out textures and parameters.
 

User offline. Last seen 1 day 18 min ago.
Posts: 230

Yeah mate, youve got to get rid of the other two material nodes. Its applying multiple mat effects to your plate. Just delete two of them and place into the remaining one.

 

The two new nodes were added in June for the grading.

 

Theres also a per map slot in world info that was added in may. 

User offline. Last seen 1 week 4 days ago.
Posts: 406

in reference to the edge detect material, does anyone know why the scene turns black with white lines? I've been trying to get it so that you only see black lines; like a toon shader. I watched chapter 01-07 of the DVD like 10 time now and I still don't get it.

User offline. Last seen 37 weeks 7 hours ago.
Posts: 147

its because all you're rendering out scene depth. you need to do that because otherwise you would be just simply moving every pixel of the player's view in the direction specified. by rendering the scene depth going in three different directions, you're able to overlay the parts that are "left behind" from the physical pixel shift. you need to take that overall and subtract that from a scene depth.. inverting the white and black, then using an if node, you specify color only where the outline of an object is.. otherwise a scene texture sample (the actual scene itself), is rendered..

 

tried explaining that to the best of my knowledge, but if ive made any mistake with something someone please feel free to correct me.

 

EDIT: take a look at the link i posted and u can see the material tree i came up with to achieve the outline only.

User offline. Last seen 1 week 4 days ago.
Posts: 406

At this point I'm really thinking of giving up. After talking to the guy who created the TF2 shader for UDK, it's clear to me that combining an outline shader and the TF2 shader is impossible without going deep into the code of the UDK engine which I cannot nor able to. The Outlins shader I'm using now is from Oniram and I made a few notes for myself in case I want to come back to it.

outline_shader02.jpg
User offline. Last seen 37 weeks 7 hours ago.
Posts: 147

so wait.. are you trying to globally change everything to have the tf2 shading? or your issue is that simply combining the two individually just doesnt give u the desired result? as far as globally changing things.. yeah ud have to come up with custom code nodes for your materials. sometimes outline shaders even use code in the material (borderlands and dungeon defense). overall ive gotten some great results from the tf2 shader.. just using very basic textures.. (baked normal, AO overlay on solid color for diffuse.. edited level and saturation for spec).

 

now here's a look at the shader im using.. pretty much exactly the same as from steffen unger.. the only changes i have is that now im plugging directly into diffuse and spec, instead of customlighting. ive never been able to figure out that custom node so i just stay away from it.

 

http://img.photobucket.com/albums/v666/Oniram/jdshader.jpg

 

now also this material tree i grabbed a few months ago online. i apologize for not remembering who this shader belongs to, but i do not claim it as my own. i personally have not tried it out but maybe it could clue you into a few things.

 

http://img.photobucket.com/albums/v666/Oniram/cel-material.jpg

 

hope this helps.

User offline. Last seen 1 week 4 days ago.
Posts: 406

Oniram wrote:

so wait.. are you trying to globally change everything to have the tf2 shading? or your issue is that simply combining the two individually just doesnt give u the desired result? as far as globally changing things.. yeah ud have to come up with custom code nodes for your materials. sometimes outline shaders even use code in the material (borderlands and dungeon defense). overall ive gotten some great results from the tf2 shader.. just using very basic textures.. (baked normal, AO overlay on solid color for diffuse.. edited level and saturation for spec).

 

now here's a look at the shader im using.. pretty much exactly the same as from steffen unger.. the only changes i have is that now im plugging directly into diffuse and spec, instead of customlighting. ive never been able to figure out that custom node so i just stay away from it.

 

http://img.photobucket.com/albums/v666/Oniram/jdshader.jpg

 

now also this material tree i grabbed a few months ago online. i apologize for not remembering who this shader belongs to, but i do not claim it as my own. i personally have not tried it out but maybe it could clue you into a few things.

 

http://img.photobucket.com/albums/v666/Oniram/cel-material.jpg

 

hope this helps.

yeah, I was basically trying to use the TF2 shader and the outline together globally or rather in the Post Process console in UDK. I don't have a clue custom nodes so for now I'm just using an outline shader. I couldn't tell whether or not the TF2 shader I modified was working properly. At least this experience has helped me learn more about materials in UDK.

User offline. Last seen 37 weeks 7 hours ago.
Posts: 147

so i just did another adaptation of the material from the dvd. I had been trying to get my head around doing a distortion effect, simulating what you see in the distance when its hot outside. i got it basically working.. it could use some more tweaking, and its also very dependent on the texture (i just did basic clouds). here's a shot of the

 

 

 

here's a shot of what it does (over exaggerated)

 

User offline. Last seen 1 year 37 weeks ago.
Posts: 2

This thread has been extremely helpful in learning some ways to manipulate materials. 

On a sorta but not really related note, I've been trying to de-saturate and add some grain to my Gears of War level.  I wanted an effect like this picture: http://www.shacknews.com/screenshots.x?gallery=10458&game_id=5483&id=123...

*Please excuse the language on the pic, the pic isn't mine.

I wanted that dark grainy effect and I've been trying to create a grainy material to put in the chain but none really come close to that look.  Any help would be greatly appreciated Laughing out loud

-Grant

User offline. Last seen 37 weeks 7 hours ago.
Posts: 147

if you take a look at the september release of UDK, there is now a post process effect called Film Grain. I have not used it yet but it may be something you're looking for.

(From udk.com)

Rendering

  • Added ‘ImageGrain’ to ‘UberPostProcess.’
  • Improved post processing.
    • Uses less memory.
    •  Better CPU/GPU performance.
    •  Improved quality and consistency.
    •  New features such as HDR scale and film grain.
  • Optimized distortion pass.
  • Fixed multiple split-screen issues causing color leaking.
  • 'F5' key now enables shader complexity mode by default.

 

As far as desaturating, inside of the uberpostrpocess you have an option for highlights, mid-tones, and shadow colors. as well as a desaturation option. Once you nail down a good color scheme for your scene you can then go ahead and desaturate it some. so no need for any material creation. Laughing out loud

also you can keep your uberpostprocess settings as default and add a postprocess volume, which will only apply your color changes to the area within that volume.

User offline. Last seen 1 week 4 days ago.
Posts: 406

So I'm going through the UDN website looking for some speed tree info when I find this, http://udn.epicgames.com/Three/DevelopmentKitGemsSobelEdgeDetection.html. I can't beleive I missed this. All that hard work when I could've just looked it up.

User offline. Last seen 30 weeks 2 days ago.
Posts: 28

From what I know those UDK gems are a recent thing. The one who brought it to my attention seems to have found it round the end of February.

User offline. Last seen 1 day 17 hours ago.
Administrator
Posts: 4182

Laughing out loud

Wouldn't it be awesome if UDK has a "add stroke" button? Sticking out tongue

User offline. Last seen 1 week 4 days ago.
Posts: 406

metalliandy wrote:

Laughing out loud

Wouldn't it be awesome if UDK has a "add stroke" button? Sticking out tongue

SO Awesome!!!!!!!!!!!!!!

or at least make it less complicated.

User offline. Last seen 1 year 37 weeks ago.
Posts: 2

hey kaze369,

 

was looking at your post about some of the issues you were having with the edge detection materials in UDK and i'm running into some of my own. i'm trying to get the edge detection material (not the image edge one) to work but everything turns black. i believe i have the proper node structure but not sure if its a setting somewhere. did you run into this issue when you created yours? 

 

i've attached an image of my node setup to compare. 

 

is there anything i should look out for?

my current settings are 

 

ScreenPos is flagged with Screen Align

u/v offset is both -0.001

 

any help would be greatly appreciated! 

thanks!

ed_mat_udk.jpg
User offline. Last seen 1 week 4 days ago.
Posts: 406

<span word="tammers" data-scaytid="1">tammers</span> wrote:

hey kaze369,

 

was looking at your post about some of the issues you were having with the edge detection materials in UDK and i'm running into some of my own. i'm trying to get the edge detection material (not the image edge one) to work but everything turns black. i believe i have the proper node structure but not sure if its a setting somewhere. did you run into this issue when you created yours? 

 

i've attached an image of my node setup to compare. 

 

is there anything i should look out for?

my current settings are 

 

ScreenPos is flagged with Screen Align

u/v offset is both -0.001

 

any help would be greatly appreciated! 

thanks!

If you read further down the thread I ended up using someone else's material node structure and eventually I found a edge detection shader from the UDN website. The one from the UDN website works really well and has a lot of options to play with so you should go there. The tutorial will show you everything you need to do to make it work.

Probably a late reply and the topic is dead, but have you tried making the material translucent and the blend mode multiply or modulate? with white back and black lines that would probably work. for those looking for a solution, this problem has already been solved here: http://www.polycount.com/forum/showpost.php?p=1061981&postcount=11

how would you create a material like legend of Zelda or Raymond kind of style?

This Post needs Your Comment!

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Are you human?