Raytracing green leather

Make art for user-made content.

Moderator: Forum Moderators

Forum rules
Before posting critique in this forum, you must read the following thread:
Post Reply
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Raytracing green leather

Post by Simons Mith »

OK, a sample image attached: A block of metal - supposed to be steel, and two blocks which are supposed to be brown and green leather. They have different colours, but all their other optical properties are identical. [Second row objects are just first row objects in a different order.]

Now, soft leather is relatively easy. What I'm trying to do is create hard cuirbouilli-style leather, which is actually quite glossy. But if you make it too glossy, it starts to look like plastic instead.

I chose a much darker base colour for the green leather. It's the brown leather base plus a bit of extra green and blue, and slightly less red.

The relevant part of the program code that produced this image is below. Don't worry too much about the details if you're not a coder. If you want me to explain something specific, ask, but I can translate 'make it brighter/duller' 'make the highlights larger/smaller' and suchlike into PoVspeak and rerender the scene.
The numbers I've been tweaking have mostly been the phong and phong_size values.

This is an indoor scene under diffuse natural white light, (very like a grey day) so I would expect the colours to be a bit flat. I can change it to outdoors on a sunnier day if desired.

Code: Select all

#declare GreenLeather =
    color rgb <0.32, 0.34, 0.18>
   (other properties same as brown leather)

#declare BrownLeather =
  pigment {    color rgb <0.36, 0.22, 0.09>  }
  normal {    dents 0.05  }
  finish {    ambient 0.25    diffuse 0.50    phong 0.70    phong_size 20
    roughness 0.2    reflection 0.05  }

#declare Steel =
  pigment { color rgb <0.94, 0.93, 0.85>  }
  normal { dents 0.01  }
  finish { ambient 0.25     brilliance 4    diffuse 0.5    metallic    specular 0.80        roughness 0.025    reflection 0.4  }
I'm not trying to get a wrinkled leathery surface texture. I want smooth, shiny and highly-polished (for leather). It would be nice to produce a more realistic-looking steel as well. So what needs changing?

Edit: By 'eck, the forum does make a mess of rendering JPEGs, doesn't it? click on the picture to see the true colours.
Attachments
Raytraced brown and green leather and metal.
Raytraced brown and green leather and metal.
 
User avatar
TL
Posts: 511
Joined: March 3rd, 2007, 3:02 am

Re: Raytracing green leather

Post by TL »

Spot highlights seem awfully strong on the leather pieces; I would think they would have more diffuse lighting. It's supposed to be shiny, yeah, but I'd expect a little more of an all-over sheen.
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Raytracing green leather

Post by thespaceinvader »

They look very, very smooth to be leather - even highly polished leather has some grain to it, especially when it's being stretched into non-leather-like shapes...
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Ranger M
Art Contributor
Posts: 1965
Joined: December 8th, 2005, 9:13 pm
Location: England

Re: Raytracing green leather

Post by Ranger M »

TL wrote:Spot highlights seem awfully strong on the leather pieces; I would think they would have more diffuse lighting. It's supposed to be shiny, yeah, but I'd expect a little more of an all-over sheen.
I agree with TL here

*puts on physics hat*

metal gets very bright point reflections (spot highlights, whatever) because it's highly reflective, and very smooth, the reflective part has little effect on the size of these bright spots, but the smooth part does. You see because it's smooth there is only one sweet spot where 90% of the light from the source that hits that spot is reflected directly into your eyes, but on a diffuse surface, like leather, which is actually really allot of very small surfaces, the light is scattered, and instead you might get 60% of the light from the sweet spot, and 50% from the area around it, because although they aren't the sweet spot there is more diffused light coming at you (BTW, these percentages are completely made up, but they are accurate in the perception they give you, so just don't think about them and the explination should make sense)
ilor
Inactive Developer
Posts: 129
Joined: March 24th, 2008, 9:05 pm

Re: Raytracing green leather

Post by ilor »

Leather is very much about the texture. You need bumps, creasses, grain and whatnot. Bump mapping with some sort of procedural texture should help a lot.

Have a look at http://img207.imageshack.us/img207/8258/redbk6.png it would look like plastic but the random cellular structure gives it a leathery feel. It was suposed to be similar to http://www.lakewoodconferences.com/dire ... eather.jpg and it kinda-sorta looks similar, could be a lot better but I'm done with these classes so I didn't fiddle around with it much more.

Also, this is from a homemade raytracer, it should be a lot easier to experiment in a real program ;)
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Raytracing green leather

Post by Simons Mith »

Thanks for your comments so far, guys. Round 2:

First, a note of caution. People say 'leather' and think they're talking about the same thing. In fact its texture varies quite a lot. I've got a sheepskin jacket with a similar texture to Ilor's example (grain size 2-3mm), and I saw a black handbag yesterday with a grain size of 6-8mm or so.

But a common technique for treating leather is to press it through metal rollers, which can completely eliminate the visible grain, if smooth rollers are used at a high enough pressure. I have leather shoes and belts demonstrating a wide range of such textures. The extreme case is patent leather which has no visible grain at all, perhaps not even under a magnifying glass. If I had a pair of patent leather shoes, I'd check.

Boiling in oil, water or wax, or coating with wax, and of course plain old polish (or spit and polish) can also have big effects on leather's surface appearance.

Two cuir bouilli references I found - a WWII helmet, rather dull, with noticeable colour variation, and the grain not visible from 2-3 feet away, and the attached armour which is quite a light brown, glossy, and has half of one panel saturated to white by the camera flash. Again, no grain to speak of. These opposite extremes demonstrate most of the available range of shininess.

So, back to my samples.

First: Is the lighting OK? I can make it brighter, sunnier, out-of-doors, if that's thought to be a good idea. Unless requested otherwise I'll stick with the existing neutral lighting scheme.

Second: Are those credible leather colours? You can dye or bleach leather and get most shades; black, brown, blue, green, red, even white. Shall I alter them? Again, shout out. (Once the textures are sorted, I'll produce blue, red and black leather variants too.) Current colours are rgb 32%, 34%, 18% and rgb 36% 22% 9%. They're both pretty dark.

Third: I'm going to mock up a rough chest plate and vambraces in addition to these funny 'pawn' sample objects. To follow later.

Fourth: To start with, I'm going for very smooth leather, like the sample armour, because the texture modelling will be simpler. And I think it will be more sensitive to errors, hopefully making them easier to identify and fix. The PoVRay 'crackle' texture should work nicely for textured leather, and I'll do that as a secondary objective. But getting smooth leather right is a higher priority.

Fifth: The steel is based on a silver metal texture, and I think it's too light. Maybe too yellow as well. Will try to fix this, because I'd like to have a credible steel to place alongside the leather, for comparison under identical lighting conditions. Perhaps it's too shiny as well. The Household Cavalry have steel breastplates that really are as mirror-bright as in the image above (in fact, slightly more so!), but that's going a bit too far for Wesnoth, I feel.
Attachments
WWII cuir bouilli helmet reference
WWII cuir bouilli helmet reference
helmet.jpeg (9.04 KiB) Viewed 7804 times
Cuir bouilli armour reference
Cuir bouilli armour reference
 
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Raytracing green leather

Post by Simons Mith »

I've been playing around with various parameters. Decreased phong reduces the saturation of the highlights. Decreased phong_size reduces the tightness of the highlights, making them more spread out. I've tried a lighter brown and a lighter green; I think the new brown is a much better 'light' leather, but the green is too light. And the leather now uses bumps 0.05 scaled by 0.05, which I think is about the right amount of texturing. Actually, that's maybe a bit high and I would like to reduce it slightly, but any less and it's pretty much invisible at this resolution.

Also the scene's ambient and diffuse lighting (0.25 and 0.50 => 0.40 and 0.75) has been bumped up making everything look brighter.

Edits (corrected copy errors, reminder to self; switch to PNG for future hi-q renders, otherwise JPEG artifacts may start interfering with texture criticisms.)

Code: Select all

Leather = texture {
  normal { bumps 0.05 scale 0.05 }
  finish { ambient 0.40, diffuse 0.75, phong 0.60, phong_size 5, roughness 0.5, reflection 0.02 }
}

#declare BrownLeather01 = texture { Leather
  pigment { color rgb <0.55, 0.30, 0.10> }
}

#declare GreenLeather01 = texture { Leather
  pigment { color rgb <0.35, 0.50, 0.10> }
}

#declare BrownLeather02 = texture { Leather
  pigment { color rgb <0.36, 0.22, 0.09> }
}

#declare GreenLeather02 = texture { Leather
  pigment { color rgb <0.32, 0.34, 0.18> }
}

#declare Steel = texture {
  pigment { color rgb <0.75, 0.75, 0.72> }
  normal { dents 0.01 }
  finish { ambient 0.40, brilliance 4, diffuse 0.75, metallic, specular 0.85, roughness 0.01, reflection 0.2 }
}
So now I'm after the next round of feedback. Please fire away.
Attachments
Second green leather test render
Second green leather test render
 
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Raytracing green leather

Post by AI »

Simons Mith wrote:But a common technique for treating leather is to press it through metal rollers, which can completely eliminate the visible grain, if smooth rollers are used at a high enough pressure. I have leather shoes and belts demonstrating a wide range of such textures. The extreme case is patent leather which has no visible grain at all, perhaps not even under a magnifying glass. If I had a pair of patent leather shoes, I'd check.
What's left of my shoes seems to be pretty smooth without any discernible grain.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Raytracing green leather

Post by Simons Mith »

Quick update: Thinking the new leathers were 'getting there' I mocked up a breastplate-ish object and applied the lighter brown and green textures. Results: metal. Metal metal metal. The brown looked more like newly-polished bronze. So I've been turning down the dials still further, and may have something recognisable by this evening.

Edit: OK, version 3 attached and full PoV source code. Slight variation in surface colour is due to the bumps finish, which perturbs the normals. I hope the shininess is about right for new hard leather - I think I've got it about the same as for e.g. a leather saddle now. I've tried darker and lighter greens and browns - these are the best so far. I still worry that the green shade would only really be attainable with modern dyes, and would welcome comments.

Key components:

Code: Select all

#declare Leather = texture {
  normal { bumps 0.125 scale 0.5 }
  finish { ambient 0.25, diffuse 0.65, phong 0.225, phong_size 10, reflection 0.01 }
}

#declare BrownLeather=pigment { color rgb <0.38, 0.23, 0.09> }
#declare GreenLeather=pigment { color rgb <0.32, 0.36, 0.17> }

#declare Steel = texture { pigment { color rgb <0.65, 0.65, 0.63> }
  normal { bumps 0.025 scale 1.0 }
  finish { ambient 0.25, brilliance 4, diffuse 0.65, metallic, specular 0.65, roughness 0.01, reflection 0.2 }
}
I think the steel's too bumpy (and I'm not sure about its colour, the highlights or how reflective it should be), and I'm not sure the leather is bumpy enough. And could it be glossier? Brighter?

In other words, nothing's quite 100% right yet, but they're getting about as close as I can get them without further feedback from someone with an artist's eye.

Click on the pic as usual.
Attachments
leather.txt
PoVRay source code. Rename to .pov to use
(8.45 KiB) Downloaded 304 times
Leather breastplatey things
Leather breastplatey things
 
User avatar
TL
Posts: 511
Joined: March 3rd, 2007, 3:02 am

Re: Raytracing green leather

Post by TL »

Leather "looks" right for armor in good repair (I'm not an expert, but it resembles examples I've seen--although I'm not sure the people constructing those examples were experts either). I'm pretty sure if this was polished dress armor it could get be made much shinier (as in your reference pic, which is not the shiniest leather armor I've ever seen pictures of either), but for practical use it seems about right. If anything I think it may be ever so slightly too bumpy--the texture almost seems more velvet or suede, although to some extent I would tend to expect that for worn leather. Again, if you're going for not quite perfect peak condition but still well-maintained that probably seems about right.
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Raytracing green leather

Post by thespaceinvader »

Details like seams, stitches, rivets and damage will add the appearance of leather rather than metal. But i should also add the right the way through, the white leather is waaaay too reflective. It looks more like it's mirrored.
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Raytracing green leather

Post by Simons Mith »

thespaceinvader wrote:Details like seams, stitches, rivets and damage will add the appearance of leather rather than metal.
Of course, but I want the basic material looking as leathery as is possible, without extra visual cues.
tsi wrote: But i should also add the right the way through, the white leather is waaaay too reflective. It looks more like it's mirrored.
That's supposed to be steel, under the same lighting conditions, for comparison. But does it look like steel?
 
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Raytracing green leather

Post by thespaceinvader »

Aaaah. totally didn't get that >.<

Yeah, it looks pretty good, but it could do with darker shadows i think. It's difficult because the lighting is so articificial...
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Raytracing green leather

Post by Simons Mith »

Well, here's another test. If the surface properties are right for leather, they'll continue to work for other colours too. So I've added black, red and blue to the list. Getting the base colours right took a lot of tries - I still don't really have much instinct for what's right and what's not. I've also darkened the older brown and green leathers somewhat. This picture has been made brighter (but without altering the base colours) by increasing the ambient and diffuse values.

Unless I get people finding fault - and I hope things are now roughly correct - I'll start on a suitable textured leather, which should be easier.
And I need to work on some outdoor lighting too, I think - the indoor lighting I'm using here is making further refinements hard to identify.

[Edit: Update: I'm doing some 1600x1200 high-quality renders under sunny outdoor lighting. These are taking a lot longer to run. I'll probably post them at the end of the weekend; there's a couple more tweaks I want to try. Meantime here's a summary of what I've found.]

[Edit 15/03/09: I did finish the hi-res renders, but I hadn't appreciated how far out of calibration my monitor had drifted. Some earlier colours I'd rejected as too dark look a lot better, and some later shades are now plainly too bright. Need to do some more re-rendering.]

First, probably the major factor; use very dark colours or low saturations for leather; anything brighter than about RGB 40%,40%,40% very quickly starts looking metallic, and % RGB values in the 20s to low 30s are generally sufficient, and even for new leather, keep the white highlights very weak and spread out. I think the colour was LordBob's biggest mistake; his Javelineer armour was so light, no amount of mucking about with highlights could make it look anything but metallic. The base colour of my latest brown leather is RGB 38%, 23%, 9%, the green is 24%, 30%, 20%. The black leather values are all in the low teens and it's too dark, and the blue's values are in the low 20s (also too dark). The red has an RGB value of 38%, 15%, 13% and that level of redness is pushing it. (Using a colour picker tool over the image will show the sort of colour ranges that a given base colour produces.)

[Edit edit: I reckon even white leather is likely to be only RGB 60%/60%/60% or so]


There are problems with the levels of ambient lighting ('ambient' controls the brightness of surfaces that are completely in shadow) in that scene, I admit. Recommended range for ambient is normally 20-30%; I probably needed to bump it up to 50% or so or use a setting known as radiosity which really slows down rendering speeds.

For highlights, I reckon you could often get away with no highlights, or next to none. My sample leather currently has a phong value of 40%; for comparison the metal uses a value of 75%. For leather you could easily go down to 15-20% and it will still look very new. Older leather, 2%-5%.

Leather surface textures - I'm working on these, they're too hard to explain, stick around for the sample renders in a couple of days. Pictures will make it much clearer.


By the way, if anyone would like me to try some other parameters, just ask; all I have to do is change a number or two and set the computer rendering in the background while I do other work. Or you can download PoVray and render them for yourself; it's free, and it's as multi-platform as Wesnoth is. http://www.povray.org/ ]
Attachments
leather.txt
Latest Pov leather source code, outdoor lighting. Rename to .pov to use.
(10.49 KiB) Downloaded 297 times
Five shades of leather plus steel
Five shades of leather plus steel
 
Post Reply