# Look for triple sharp ### comments - this is what I changed since the last step.
STEP 6
I'm happy with the position and size. Blend is still too strong. Bruises are multicolored.
Going to put a color ramp on the radius from center of bruise.
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
apply to diffuse color of surface, also set soft specular
s = Surface(clr, 1, 1, .2, .5)
Move cy down a bit
cx = .4
cy = .525
Going to use a simple circular pattern to blend in the bruise.
x = U - cx
y = V - cy
In r, I'm putting the distance from the cx cy position.
r = sqrt(x * x + y * y)
We'll put the range of the bruise in this variable, br.
br = .07
Bruise color based on r, distance from center.
I started using the color picker here, so because I'm reading colors off
in integers, I switch to using the IColor function. I actually loaded this
mat in, then adjusted the colors in the mat room, not here. Then copied
the values back. This took about ten iterations.
bruiseclr = ColorRamp(
IColor(90, 44, 112),
IColor(90, 56, 113),
IColor(90,70, 153),
IColor(90, 41, 154),
Scale(r, 0, br)
)
Now I'll create the blender input using the Scale function.
A certain distance (br) from the center, the bruise is completely gone - this distance
goes in the second argument so that Scale produces 0 when r = br.
We'll make the bruise come full on at half the br distance, so br/2 goes in the third
argument - this tells the Scale when to produce a 1.
Reduce max value of blender by just multiplying something less than 1.
maxblend = .3
bruiseblender = maxblend * Scale(r, br, br / 2)
#Finally I simply blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)