Hi
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...
Replies
It looks like you're trying to do this: http://www.polycount.com/forum/showthread.php?t=97548
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.
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...
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.
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...
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:
return max(A,B);
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.
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...