Forum: Poser - OFFICIAL


Subject: attn bagginsbill - procedural bruising?

PapaBlueMarlin opened this issue on Aug 18, 2006 ยท 87 posts


bagginsbill posted Sat, 19 August 2006 at 2:12 PM

# STEP 2 # Add some code for a bruise.

load Jame's face image here

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)

Try out a bruise color

bruiseclr = Color(.5, .2, .7)

This is roughly where I want the bruised centered.

cx = .4
cy = .45

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 = .1

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.

bruiseblender = Scale(r, br, br / 2)

#Finally I simpley 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)