how to make stained glass?

General questions about Indigo, the scene format, rendering etc...
User avatar
Vampyre
Posts: 55
Joined: Sun Jan 06, 2008 12:38 am

how to make stained glass?

Post by Vampyre » Sat Feb 09, 2008 3:03 am

has any successfully made a stained glass material? what i'd really like is a transparent glass with different colors, but when i try to blend a transparent specular with anything it gets either faded colors or other weird errors.

I dont want just color glass, i actually want texture based color variance in the glass. i'm using indigo 1.0.4 and the coresponding blendigo. thanks in advance for any advice

Vanessa07
Posts: 312
Joined: Mon Sep 24, 2007 11:17 pm
Location: Suisse

Post by Vanessa07 » Sat Feb 09, 2008 3:59 am

Not sure to understand, any reference image? :?

User avatar
Vampyre
Posts: 55
Joined: Sun Jan 06, 2008 12:38 am

Post by Vampyre » Sat Feb 09, 2008 7:24 am

sure. here's an image i found on google

http://images.google.com/imgres?imgurl= ... l%26sa%3DN

notice how in the purple glass, each segment has some color variance in the glass itself, and some of the color we see is from the background. I want this result.

right now i'm trying to fake it using a blend between a diffuse transparent shader, and an image generated by blenders internal raytracer. thanks a lot for any advice or pointers

StompinTom
Indigo 100
Posts: 1828
Joined: Mon Sep 04, 2006 3:33 pm

Post by StompinTom » Sat Feb 09, 2008 9:07 am

as of now, transparent specular materials cant be textured with color. theres the whole problem of how to map a 2d image onto a 3d volume (absorption takes thickness/volume into account, so how will the renderer know how deep the image map affects the color of the material? what about intersections? etc etc) at least thats how i understand the problem.

User avatar
Vampyre
Posts: 55
Joined: Sun Jan 06, 2008 12:38 am

i'd guessed as much

Post by Vampyre » Sat Feb 09, 2008 9:19 am

thanks for the input :)

I had guessed as much. I can think of a couple of ways to get around that
problem, from a coders point of view.. but since messing with the indigo code
isn't an option i was just wondering if anyone had found a convincing way to
fake it with blended materials or something.

as it is now, i think im just going to render the scene twice, once with a
diffuse transparent, and once with a specular transparent and layer them.

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Sat Feb 09, 2008 9:30 am

Is the image map big or complex? If not, trace over it with geometry and model every pane.
Won't blame you if you think that's too much work though ;)

User avatar
Vampyre
Posts: 55
Joined: Sun Jan 06, 2008 12:38 am

thought of that too

Post by Vampyre » Sat Feb 09, 2008 11:52 am

actually, that was my first plan, but then i realized, each segment/cell of glass should have color variation, not just the whole window pane. i know, im picky huh? :D the layering method hack works pretty well , but i'm not sure if the color variation will survive the layering. i'll know in a couple of days when the renders are complete

Vanessa07
Posts: 312
Joined: Mon Sep 24, 2007 11:17 pm
Location: Suisse

Post by Vanessa07 » Sun Feb 10, 2008 4:45 am

Something like this? :wink:
Attachments
im1202577011.png
im1202577011.png (719.47 KiB) Viewed 17040 times
im1202574962.png
im1202574962.png (712.63 KiB) Viewed 17053 times

sth
Posts: 57
Joined: Mon Mar 05, 2007 1:55 am

Post by sth » Sun Feb 10, 2008 9:58 pm

StompinTom wrote:as of now, transparent specular materials cant be textured with color. theres the whole problem of how to map a 2d image onto a 3d volume (absorption takes thickness/volume into account, so how will the renderer know how deep the image map affects the color of the material? what about intersections? etc etc) at least thats how i understand the problem.
I like the way how it is solved in other renderers (biased). You can treat texture as a shell of transparent paint on your glass. All settings could be mapped :P
For sss there could be also mapped "sss deepness map" which would mean at what distance from the surface color from "sss color map" would be changed into colir from "material color map"
But I don't know is it possible to follow this way. It's only my imagination :wink:
Attachments
mappedglass.gif
It's how I see textured glass
mappedglass.gif (2.4 KiB) Viewed 16982 times

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Feb 11, 2008 12:09 am

Interesting how your light starts out white and then suddenly gains energy when going through something absorbing :P

Anyway...
I think, the problem is, that absorption in Indigo is depth based. If you hit a transparent coloured plane (a perfect one without any thickness), the colour wont be absorbed at all... (except the light hits one edge of the plane and leaves through an other) as the light doesn't have any chance to be blocked by perfectly flat atoms, so to say....
of course, you could simply save both colours and blend their effect 50:50, but I think, that wouldn't be the correct approach. Who says, that the light passes through the blue part (in your pic) exactly half the time, and through the yellow part the other half?
Indigo'd need to blend the colour towards the middle of the mesh.
there then could be two ways:
1) the two colours slowly fade to a grey absorption of the strength in the middle of them (averaged percent of absorbed light)
2) the colours fade in each other.

Next problem: a solid object: there are more than two sides which affect the colour....
Indigo basically'd need to calculate a volumetric 3D colour texture, based on the values of the 2D one, on the mesh and on the UV map.

Would take forever to calculate and would use a ton of RAM, I guess...

It still would be useful :)

sth
Posts: 57
Joined: Mon Mar 05, 2007 1:55 am

Post by sth » Mon Feb 11, 2008 12:41 am

Kram1032 wrote:Interesting how your light starts out white and then suddenly gains energy when going through something absorbing :P

Anyway...
I think, the problem is, that absorption in Indigo is depth based.
In my example i was thinking about a color as a very thin transparent coat painted over clear glass block (i skipped refraction on image)
that's why light changes color on the surface :wink:
Kram1032 wrote:of course, you could simply save both colours and blend their effect 50:50, but I think, that wouldn't be the correct approach. Who says, that the light passes through the blue part (in your pic) exactly half the time, and through the yellow part the other half?
Indigo'd need to blend the colour towards the middle of the mesh.
My idea is not to mix them in the middle of material. Color would be put directly on the shell. I think would be no need to change medium material a lot :P just add on top of it kind of "absorbing layer"

this is what I "googled': :wink:
http://www.webindia123.com/craft/paint/ ... make2a.jpg
http://www.hobbycraft.co.uk/tech_pages/ ... GLASS4.jpg
http://www.christie.nhs.uk/patients/reh ... inting.jpg
http://www.thearttable.com/Classes/all4classes.jpg

there can also be 'solid' - non transparent paint - now it can be simulated by mixing with custom map glass and diffuse or phong (working now if sss is not used)
look at:
http://www.greece.k12.ny.us/commed/Phot ... inting.jpg
http://www.csc.gov.sg/HTML/Newsletter/o ... entary.jpg
http://www.whimsicalsisters.com/

As you see it can be laid on whatever material of different shape. :wink:
Effect is easily predictable.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Feb 11, 2008 12:45 am

I know, what your idea was.
Though, it would mean a 0 meter thick layer of colour, which would absorb 0% of the light (as that's the way, Indigo calculates it...)

That blending in the middle was an expanded idea by me, so to say...

those colours still have thickness... and quite a high absorption.
and additionally, they're impossibly used uniformly...

what *might* work, is, to use a map in this way:

two additional parameters:
- average thickness
- maximum thickness

Indigo'd automatically translate the image into absorptionvalues, based on those two values and the values of the map.

additionally, indigo'd use the map as a bumpmap, simulating the thickness of the texture (or when finally implemented: no simulating and MPD)

and it could also make the actual surface below thinner (that's why there's the average value... It'd make the surface less perfect)

one problem remains (at least, if all the stuff above actually'd work...)
What's about the IoR and stuff of the coating material? I don't think, Window Colours have about the same IoR as window glass :P

sth
Posts: 57
Joined: Mon Mar 05, 2007 1:55 am

Post by sth » Mon Feb 11, 2008 1:08 am

I think that bump would complicate things a lot. (Two bumpsmaps? :P one for glass and one for coat + two IORmaps :shock:). I think that at the start it should be only one map and one control 'strength' (or as you call this - 'depth') other settings inherited.
And maybe in the future........ 'coatlike material' which could be applied to every mat?

@Kram
I don't understand one thing.... :lol:
Why do we have to do 'experimental imaginative mess' in every serious topic? :oops: :P :D :lol: :wink: 8)

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon Feb 11, 2008 1:19 am

well, the bumpmap of the coating material would be directly created from the colouring image, based on the darkness and the two values for thickness :P

About the 'experimental imaginative mess': why not? :P

sth
Posts: 57
Joined: Mon Mar 05, 2007 1:55 am

Post by sth » Mon Feb 11, 2008 1:23 am

Oh..... I see somewhere 'need of life' :twisted: :lol:

[edit]
I hope Ono's not angry about this kind of inspiration :roll:

Post Reply
21 posts

Who is online

Users browsing this forum: No registered users and 2 guests