You would just question me on just enough to get me to write it wouldn't you? :P Thanks for the push. It took far longer than I'd thought all because it took me a while to remember/figure out the general form for making these sub gradations, but the mental math felt good. I finally had to break out the paper and work out…
The only issue with procedurally gradient mapping in udk atm is the number of lerps you'd wind up putting in for more than a single color change. if you want a 2 color "gradient node" just make 2 color constants and lerp between them with the alpha being whatever your were gradienting over. You could do it in a custom node…
You'll want to have a small buffer range between each gradient, though, to account for compression artifacts. My only issue with that is the relative lack of flexibility in the gradient maps themselves (you'll need a different set of gradient textures per color set, unless you start playing with stacked sets of gradient…
Hey man, I thought I'd help you out a bit with a sorting function so you don't have to stick those color nodes in a particular order. Just the alpha values set up properly. float3 output; //output colorconst uint NUMCOLORS = 4; //number of colors for programatic gradientfloat4 gradient[NUMCOLORS]; //here's the actual…
This is effing fatnastic, Raz you sexy beast! Just tried it out and it works like a charm. This could be really useful on the tileable/organic stuff. Too bad it doesn't eliminate a diffuse texture lookup, even though it's small. You could make a gradient procedurally jumping through some hoops in UDK, but if epic made a…
Vailias: That's interesting, but what would you say the benefit to this procedural method is? EDIT: As a start to a proper gradient node it's cool - you'd need an interface though! :)
Hey, Vailias, this is totally awesome. A lot better than messing around with all the lerp and uv nodes. And thanks for the comments - made the thing more transparent for the unfamiliar with HLSL. I learned a thing or two about it thanks to you. The color parametrization is also useful to just quickly create a bunch of…
Great stuff, guys! And ofcourse you make some great points as for what a true gradient node could do - in my mind though, it would need to offer unlimited colors on the gradient to compete with Photoshop for doing certain things, but to be sure, this is great work and a big step on the way. D1ver, I don't know how you do…
:) Just had to play around some more with this and check out how it could work for a post process shader. This one uses a desaturated scene sample with a bit of green boost in the desat, plus the "uber post process effect" inline after it for things like bloom, grain, and dof. All these come from the same code I had…
D1ver: Thanks. I was about to write in commentary that the ordering issue could be solved with a simple bubble sort like you did. I didn't put it in though as the whole of that HLSL block gets evaluated for EVERY PIXEL of the material at EVERY draw call its visible. On a simple thing like this it doesn't add that much…