View Full Version : Questions About PostProcess Material Effects
04-22-2012, 07:21 AM
This is my first post,so,nice to meet you...^^
I've only recently fallen in luv with this subject(MaterialFX),and am very new to shaders in general,so,please overlook the probable silliness of my inquiries(if any)...
I've created this thread to post my questions about the subject over time,so here it goes,today i was thinking about whether i can shade objects based on their 'Radius' property using the 'Object Radius' node in the editor,here's my wishful mind's best effort,which failed obviously,so can anybody tell me what i'm doing wrong and how to do it right?...^^
Here i was simply trying to color objects smaller than 400 units Pink and the rest green...silly me...
04-22-2012, 07:31 AM
Mind drawing us an example of what you mean?
It looks like you're trying to do this: http://www.polycount.com/forum/showthread.php?t=97548
04-22-2012, 07:56 AM
Not really,as i said i was thinking if it was possible to shade objects smaller than 400 units one color and other objects another,for example in the UDK's default template maps,this would color the small white cube pink and the white base rectangle mesh green...of course the ultimate goal is to extend the functionality to different sizes,but for now that was what i was trying to do...thanks for replying btw.
04-22-2012, 09:48 AM
Ooooh, I get it now.
Hmm, I have no idea how you would do that on Post-Process, since UDK relies mainly on Depth and stuff to mask out objects.
You could try to go for this: http://udn.epicgames.com/Three/DevelopmentKitGemsRenderingOccludedActors.html
Basic idea, pretty much.
Although it would require you to specifically change the mesh type, so it will affect all objects of the same mesh, and change the material a little to make it universal and not occluded based.
I'm sure someone with more knowledge in this area could help.
04-22-2012, 10:19 AM
Yea I don't think you can do that as a scene post processing effect, since that operates on a framebuffer texture (the rendered frame). That doesn't have any info on the radius of individual meshes in the frame.
04-22-2012, 10:33 AM
As a matter of fact i was reading that page yesterday(yesterday i was thinking whether it's possible to render objects behind other objects,as i said,i'm kinda enthusiastic about this thing),but that process is way over my head since it requires coding,i had the feeling it could be done solely through materials(with that Object Radius node),i'll keep looking,and please lemme know if you ever figured this out...
Ok,to the Next subject,is it possible to compare 2 Vector values in the material editor?...i basically want to compare two specific colors and if they match perform an operation on it,say change that color or make it brighter,for example compare the Scene Texture with a specific color and if it matches change that color...
Edit:I see,thanks Xen...
04-22-2012, 01:18 PM
For the color, you could basically use the desaturate node to isolate the colors you need, and then use the IF node to comparison on what the result should be.
Problem is, I'm not sure if you can dynamic enough to work on the fly, you would need to put hard values directly in the material and requires slow testing for each scene.
04-23-2012, 02:41 AM
That doesn't work since it's still considered a vector,unless i'm missing something here,can you explain a bit more about the separation process?...just to clarify,we have the scene texture and a color,and we want to compare the two...
Meanwhile is there any way to combine three seperate IF's together,is there a logical AND or something similar in the editor?cause that would solve the problem,since we can break the vector into 3 separate pieces and use three separate IFs to compare them,again,unless i'm missing something,but i have a feeling there is a hassle free way to do something like that which i don't know about...
04-23-2012, 09:00 AM
Not that I'm aware of, I think UDK needs to have all Vectors the same type when going in/out of an IF node, so trying to combine 3, while possible, would require very careful control on what type is going in and going out, so it can become pretty complicated really quickly :/
As for the isolation of color, here is an example of what I mean:
Basically, just use a Custom node, and type in it this:
Connect the colors as you see fit. It will isolate the colors you don't want (G,B) from your original texture (RGB).
I'm not sure how you would get yellow, or if that's possible.
04-24-2012, 03:32 AM
Hey Ace,first off,thats a cool trick,i wonder what else can be done through these custom codes,about the Yellow i came up with a way which i have a feeling isn't the correct way to do it(more of a brute force method i guess),anyways take a look at it,maybe you or someone else with more experience can come up with a better way...
Now again the way it is right now(only working with primary colors),i don't know how it can be applied to what i have in mind,unless we can somehow figure out a way to single out any arbitrary color instead of only the primary ones,i'm working on that and i have a feeling it can be done,again if i'm missing something here please let me know,as i said i'm a complete noob at this...
About what i was trying to do initially,i.e. comparing two colors,i came up with a way which actually kind of works,there are two major problems:
1.for some reason beyond me it only works,again,with the three primary colors,i.e. absolute red,green and blue,and nothing else...really odd.
2.it works only inside a rather small radius around the object,around 100 or so units,again really odd....anyways,here's what i did:
In the scenario above any object with a Red(1,0,0) color material changes it's color to that blue,only within that certain radius i mentioned earlier,if i get further out than that radius the color reverts back to red...
I'll be experimenting more with these...
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.