|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hello,
I have written pov-exporter for OpenSceneGraph rendering and visualization
library. It generates quite COOL results. However, I have one problem:
It seems like POV-Ray is not capable of handling OpenGL materials as it uses
just one pigment. It is even not possible to implement OpenGL texture MODULATE
mode, e.g. image (called texture in OpenGL) multiplied by the result of the
lighting that is performed on surface pigment (called material in OpenGL).
To simplify the things, I want to have one pigment for OpenGL emissive color and
another pigment for OpenGL diffuse color. POV-Ray should compute the lighting on
both of them and the final color would be sum of these. Is it possible to do
this in POV-Ray?
Thanks,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 28/07/2011 13:45, PC John nous fit lire :
> Hello,
>
> I have written pov-exporter for OpenSceneGraph rendering and visualization
> library. It generates quite COOL results. However, I have one problem:
>
> It seems like POV-Ray is not capable of handling OpenGL materials as it uses
> just one pigment. It is even not possible to implement OpenGL texture MODULATE
> mode, e.g. image (called texture in OpenGL) multiplied by the result of the
> lighting that is performed on surface pigment (called material in OpenGL).
I do not get it... (ambient 0 diffuse 1) is what would perform this
computation (but you might want also to play with the options of
light_source such as fade_power and fade_distance
> http://wiki.povray.org/content/Documentation:Reference_Section_4.3#Light_Sources
>
> To simplify the things, I want to have one pigment for OpenGL emissive color and
> another pigment for OpenGL diffuse color. POV-Ray should compute the lighting on
> both of them and the final color would be sum of these. Is it possible to do
> this in POV-Ray?
If I get it correctly:
OpenGL povray
=========+=========
emissive | ambient
diffuse | diffuse
To perform a sum, use the average pigment with relevant map
> http://wiki.povray.org/content/Documentation:Reference_Section_5.3#Average
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> > To simplify the things, I want to have one pigment for OpenGL
> > emissive color and another pigment for OpenGL diffuse color.
> > POV-Ray should compute the lighting on both of them and the
> > final color would be sum of these. Is it possible to do
> > this in POV-Ray?
>
> If I get it correctly:
> OpenGL povray
> =========+=========
> emissive | ambient
> diffuse | diffuse
>
> To perform a sum, use the average pigment with relevant map
>
> > http://wiki.povray.org/content/Documentation:Reference_Section_5.3#Average
Things are more difficult:
OpenGL povray
===============+================
ambient COLOR | ambient COLOR
diffuse COLOR | diffuse float
specular COLOR | specular float
emission COLOR | (no equivalent, but can be emulated by ambient)
In OpenGL, ambient color is real color used for the computation of ambient light
contribution to the final color, while ambient on povray side is just pigment
filter.
In OpenGL diffuse, specular and emission are all colors that can be completely
different colors while povray's diffuse and specular is just float multiplying
pigment color.
As a result, OpenGL allows to specify for example blue diffuse color - e.g.
object is blue when lit by the light coming from the scene, and red ambient
light (e.g. surface shines red, provided that there is global ambient light in
the scene).
You may wonder why I need this, but it would allow to correctly show all the
models that are used in OpenSceneGraph, OpenGL, DirectX, and real-time graphics
in general.
Thanks for any good advice,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 28/07/2011 21:25, PC John wrote:
> Things are more difficult:
only if you want it :)
> OpenGL povray
> ===============+================
> ambient COLOR | ambient COLOR
> diffuse COLOR | diffuse float
> specular COLOR | specular float
> emission COLOR | (no equivalent, but can be emulated by ambient)
texture {
average
texture_map {
//ambient
[1
pigment {[ambient pigment with all colors * 4]}
finish {diffuse 0 ambient 1}
]
//diffuse
[1
pigment {[diffuse pigment with all colors * 4]}
finish {diffuse 1 ambient 0}
]
//specular
[1
pigment {[specular pigment with all colors * 4]}
finish {diffuse 0 ambient 0 specular 1 metallic}
]
//emission
[1
pigment {[emission pigment with all colors * 4]}
finish {diffuse 0 ambient 0 emission 1}
]
}
}
didn't test it, but I believe this should do the trick
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 7/28/2011 12:25 PM, PC John wrote:
>>> To simplify the things, I want to have one pigment for OpenGL
>>> emissive color and another pigment for OpenGL diffuse color.
>>> POV-Ray should compute the lighting on both of them and the
>>> final color would be sum of these. Is it possible to do
>>> this in POV-Ray?
>>
>> If I get it correctly:
>> OpenGL povray
>> =========+=========
>> emissive | ambient
>> diffuse | diffuse
>>
>> To perform a sum, use the average pigment with relevant map
>>
>>> http://wiki.povray.org/content/Documentation:Reference_Section_5.3#Average
>
> Things are more difficult:
>
> OpenGL povray
> ===============+================
> ambient COLOR | ambient COLOR
> diffuse COLOR | diffuse float
> specular COLOR | specular float
> emission COLOR | (no equivalent, but can be emulated by ambient)
>
> In OpenGL, ambient color is real color used for the computation of ambient light
> contribution to the final color, while ambient on povray side is just pigment
> filter.
>
> In OpenGL diffuse, specular and emission are all colors that can be completely
> different colors while povray's diffuse and specular is just float multiplying
> pigment color.
>
> As a result, OpenGL allows to specify for example blue diffuse color - e.g.
> object is blue when lit by the light coming from the scene, and red ambient
> light (e.g. surface shines red, provided that there is global ambient light in
> the scene).
>
> You may wonder why I need this, but it would allow to correctly show all the
> models that are used in OpenSceneGraph, OpenGL, DirectX, and real-time graphics
> in general.
>
> Thanks for any good advice,
> John
>
>
Hmm. This may be a kind of interesting point. Not sure if such exists,
but its not completely improbable that an objects optical properties
would cause its "reflective" color to be slightly different than its
real one, like red, when looked at directly, but say, blue when seeing
the diffuse/specular results. Maybe the odd paint they make that seems
to change color, by angle, as an example, where its the reflected light
that determines that?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 29/07/2011 0:25, Zeger Knaepen wrote:
> On 28/07/2011 21:25, PC John wrote:
> didn't test it, but I believe this should do the trick
just tested it, seems to me like it works, but it would actually be
easier to do:
texture {
average
texture_map {
//ambient
[1
pigment {[ambient pigment]}
finish {diffuse 0 ambient 4}
]
//diffuse
[1
pigment {[diffuse pigment]}
finish {diffuse 4 ambient 0}
]
//specular
[1
pigment {[specular pigment]}
finish {diffuse 0 ambient 0 specular 4 metallic}
]
//emission
[1
pigment {[emission pigment]}
finish {diffuse 0 ambient 0 emission 4}
]
}
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>>> To simplify the things, I want to have one pigment for OpenGL
>>> emissive color and another pigment for OpenGL diffuse color.
>>> POV-Ray should compute the lighting on both of them and the
>>> final color would be sum of these. Is it possible to do
>>> this in POV-Ray?
>>
>> If I get it correctly:
>> OpenGL povray
>> =========+=========
>> emissive | ambient
>> diffuse | diffuse
>>
>> To perform a sum, use the average pigment with relevant map
>>
>>> http://wiki.povray.org/content/Documentation:Reference_Section_5.3#Average
>
> Things are more difficult:
>
> OpenGL povray
> ===============+================
> ambient COLOR | ambient COLOR
> diffuse COLOR | diffuse float
> specular COLOR | specular float
> emission COLOR | (no equivalent, but can be emulated by ambient)
Add this in your global_settings block:
ambient_lights Ambient_COLOR
Now, any ambient component of your finish will be MULTIPLYED by that
value. it will effectively colour the shadowed areas. With version 3.7,
it will be disabled in a radiosity scene.
For your diffuse modification you can:
1 - precompute the desired pigment OR
2 - use layered pigments with a plain filtering pigment of the desired
colour over your base texture.
If you add metallic to your finish, the specular highlights will be
coloured with the pigment. You can use a float after metallic to adjust
that colouring.
Use POV-Ray 3.7. It have an emission COLOR component for your finish.
>
> In OpenGL, ambient color is real color used for the computation of ambient light
> contribution to the final color, while ambient on povray side is just pigment
> filter.
>
> In OpenGL diffuse, specular and emission are all colors that can be completely
> different colors while povray's diffuse and specular is just float multiplying
> pigment color.
>
> As a result, OpenGL allows to specify for example blue diffuse color - e.g.
> object is blue when lit by the light coming from the scene, and red ambient
> light (e.g. surface shines red, provided that there is global ambient light in
> the scene).
>
> You may wonder why I need this, but it would allow to correctly show all the
> models that are used in OpenSceneGraph, OpenGL, DirectX, and real-time graphics
> in general.
>
> Thanks for any good advice,
> John
>
>
Just remember that those separated components are there to get faster
real time graphics at the cost of geting away from actual physicaly
correct lighting.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> On 7/28/2011 12:25 PM, PC John wrote:
>>>> To simplify the things, I want to have one pigment for OpenGL
>>>> emissive color and another pigment for OpenGL diffuse color.
>>>> POV-Ray should compute the lighting on both of them and the
>>>> final color would be sum of these. Is it possible to do
>>>> this in POV-Ray?
>>>
>>> If I get it correctly:
>>> OpenGL povray
>>> =========+=========
>>> emissive | ambient
>>> diffuse | diffuse
>>>
>>> To perform a sum, use the average pigment with relevant map
>>>
>>>> http://wiki.povray.org/content/Documentation:Reference_Section_5.3#Average
>>>>
>>
>> Things are more difficult:
>>
>> OpenGL povray
>> ===============+================
>> ambient COLOR | ambient COLOR
>> diffuse COLOR | diffuse float
>> specular COLOR | specular float
>> emission COLOR | (no equivalent, but can be emulated by ambient)
>>
>> In OpenGL, ambient color is real color used for the computation of
>> ambient light
>> contribution to the final color, while ambient on povray side is just
>> pigment
>> filter.
>>
>> In OpenGL diffuse, specular and emission are all colors that can be
>> completely
>> different colors while povray's diffuse and specular is just float
>> multiplying
>> pigment color.
>>
>> As a result, OpenGL allows to specify for example blue diffuse color -
>> e.g.
>> object is blue when lit by the light coming from the scene, and red
>> ambient
>> light (e.g. surface shines red, provided that there is global ambient
>> light in
>> the scene).
>>
>> You may wonder why I need this, but it would allow to correctly show
>> all the
>> models that are used in OpenSceneGraph, OpenGL, DirectX, and real-time
>> graphics
>> in general.
>>
>> Thanks for any good advice,
>> John
>>
>>
> Hmm. This may be a kind of interesting point. Not sure if such exists,
> but its not completely improbable that an objects optical properties
> would cause its "reflective" color to be slightly different than its
> real one, like red, when looked at directly, but say, blue when seeing
> the diffuse/specular results. Maybe the odd paint they make that seems
> to change color, by angle, as an example, where its the reflected light
> that determines that?
You can use the aoi pattern.
You can greatly alter the appearance of a surface just by changing it's
brilliance value.
You can add some reflection, and make it variable relative to the
incident angle, or make it coloured:
reflection{color, color [fresnel] [metallic float] [exponent float]
[falloff float]}
This is a VALID reflection statement:
reflection{rgb<1, 0.5, 0.1> rgb<0, 0.2, 1>}
It will reflect orange when viewed perpendicularly, and greenish blue
when viewed tengentialy.
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Zeger Knaepen <zeg### [at] povplacecom> wrote:
> just tested it, seems to me like it works, but it would actually be
> easier to do:
>
> texture {
> average
> texture_map {
> //ambient
> [1
> pigment {[ambient pigment]}
> finish {diffuse 0 ambient 4}
> ]
> [....]
> }
> }
Thanks! This average is exactly what I was looking for. Cool!
Is there a way to combine the "average result" with the uvmapping pigment? All I
want is to multiply them.
To give an example, if the computation of "average pattern" computes < 0.5, 0.5,
0.5 >, e.g. grey (50% white), multiplication with uvmapping pigment would result
in 50% intensity of the image mapped on an object.
If "average pattern" returns < 1, 0, 0 >, multiplication with uvmapping pigment
would return image filtered by red color.
Thanks,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
PC John wrote:
> Is there a way to combine the "average result" with the uvmapping pigment? All I
> want is to multiply them.
I'm not sure I fully understand your input data. Do you have the
uv-mapping pigment in addition to your other pigments? Otherwise
you can just use the uv-mapped pigment in the average.
If the pigments in the average are only intended as a filter for
some base pigment then you should probably make all your pigments in
the average use colors with filter 1 and then use layered textures
(if you assign two textures to an object the second will cover the
first, which only makes sense with some form of transparency).
However, layering textures sometimes does not work if the
individual textures are too complex.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|