Lighting model for flower petals

Started by
5 comments, last by ramirofages 7 years, 1 month ago

Hi, currently I'm working on the shading of flowers and I don't really know how can improve what I have ( screenshot attached). Currently I'm only using diffuse color (no specular) with a color ramp to use as an indexing table for the diffuse value ( mapping -1..1 to 0..1 ) and it's "ok" though it's not very visible. I've also modified the normals of the petals so they resemble the normals of a sphere to get a more uniform look (tought it also doesn't seem to make much difference).

I'm about to try out cook-torrance and see if it makes some difference. Also my model is very low poly due to having to instanciate a lot of the flowers, so it makes it a bit difficult to make something pretty and smooth.

Are there any known techniques for this kind of things ?

Here is my general scene

[attachment=35359:Screenshot_2.png]

And here the individual flower, from up and below

[attachment=35360:Screenshot_3.png]

[attachment=35361:Screenshot_4.png]

And this is the color gradient for the diffuse

[attachment=35362:Screenshot_5.png]

Advertisement
Are there any known techniques for this kind of things ?

Uh.... texture mapping?

I was able to cobble together some pretty decent looking Queen Anne's Lace for Caveman 3.0.

gallery_197293_593_557169.jpg

These are quad based textured grass and plant models. A shader that is passed a plant_center_pos and then computes a normal from there to the vertex looks like the way to go for normals. There's some software utility out there that will do it as well. What you see here doesn't have double sided lighting yet, or adjusted normals, and the grass and ground texture colors have not been matched yet. The rocks, fruit trees, and the girl are all place holder graphics.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

I guess if you want realistic shading on any type of foliage you'll want to have a look at subsurface scattering solutions. Standard BRDFs give you surface shading, which only gets you so far for organic materials where light can usually permeate quite a bit underneath the surface.

Performance-wise I don't know if you'll want to go for a full-blown SSS solution for foliage though, you might want to find a cheap approximation to get a similar effect.

For pure surface shading I guess you should use whatever fits the rest of your scene. If everything in your rendering pipeline uses standard Blinn-Phong, then shade your foliage in the same way unless you can find a valid reason not to. Switching to a physically based model like Cook-Torrance is not going to give you more visually pleasing results out of the box.

I gets all your texture budgets!

Thanks, then I'll look into SSS , and also do more work on the textures

Here's a cheap approximation to check out, wrapped diffuse: http://blog.stevemcauley.com/2013/01/30/extension-to-energy-conserving-wrapped-diffuse/

And here's the standard screenspace subsurface scattering (warning, big PPT): http://advances.realtimerendering.com/s2014/sledgehammer/Next-Generation-Post-Processing-in-Call-of-Duty-Advanced-Warfare-v17.pptx

And here's all the way back from Crysis vegetation shading, including 2 sided lighting: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch16.html

Are you trying for photo-realism? As others have mentioned, the petals are not 100% opaque, but slightly translucent and the color comes in part from subsurface scattering. That being said, your model is of a common daisy. The petals of a daisy are nearly pure white, although some will be be of a solid color (blue is common) and some white daisies have reddish tips. A pure white texture would be entirely appropriate in a game, especially when you have hundreds or thousands to draw.

For reference, daisy in sunlight:
If you look close, you'll notice that the flower head is actually a composite flower. Each of the yellow/orange bumps in the center is a single flower. This is common among flowers.
1200px-Bellis_perennis_white_(aka).jpg

Trying to find a reference image of a daisy in moonlight is proving to be difficult, but a blue tinge would seem appropriate, if not a little less than on your model. Personally, I'd keep the white texture and add the blue tinge through colored lighting. If you want to be pedantic, however, daisies close at night, so your image is technically inaccurate.

Keep in mind that all flower varieties have fundamental natural differences that go beyond color and shape. You cannot create a physically accurate lighting/texturing model for one that will be accurate for another.

Here is a high-res image of a giant sunflower I grew about four years ago. If you look close, you'll notice the large florets (outside petals) are nearly diffuse, with the base of the smaller sessile flowers having a much higher specular component.

100_1945.jpg

Link to high-res version (4000x3000 pixels) if forum software scales the linked image (very likely):
https://postimg.org/image/f3xfbn5qp/

Are you trying for photo-realism? As others have mentioned, the petals are not 100% opaque, but slightly translucent and the color comes in part from subsurface scattering. That being said, your model is of a common daisy. The petals of a daisy are nearly pure white, although some will be be of a solid color (blue is common) and some white daisies have reddish tips. A pure white texture would be entirely appropriate in a game, especially when you have hundreds or thousands to draw.

For reference, daisy in sunlight:
If you look close, you'll notice that the flower head is actually a composite flower. Each of the yellow/orange bumps in the center is a single flower. This is common among flowers.


Trying to find a reference image of a daisy in moonlight is proving to be difficult, but a blue tinge would seem appropriate, if not a little less than on your model. Personally, I'd keep the white texture and add the blue tinge through colored lighting. If you want to be pedantic, however, daisies close at night, so your image is technically inaccurate.

Keep in mind that all flower varieties have fundamental natural differences that go beyond color and shape. You cannot create a physically accurate lighting/texturing model for one that will be accurate for another.

Here is a high-res image of a giant sunflower I grew about four years ago. If you look close, you'll notice the large florets (outside petals) are nearly diffuse, with the base of the smaller sessile flowers having a much higher specular component.



Link to high-res version (4000x3000 pixels) if forum software scales the linked image (very likely):
https://postimg.org/image/f3xfbn5qp/

Thanks a lot, your analysis was very helpful !! And on a side note, I've never seen a daisy in my life :P they don't grow where I live, so I didn't know they close at night. So thats probably why I also couln't find one of those during night

This topic is closed to new replies.

Advertisement