|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
High!
I'm currently trying to build a gradient y texture to generate a 16 bit
heightfield from an isosurface terrain. Here's the code:
#declare HF16 =
texture
{
pigment
{
gradient y
pigment_map
{
#declare a=0;
#while (a<127)
[a/256
pigment // here the error occurs
{
gradient y
color_map
{
[0 rgb <a/255, 0, 0>]
[1 rgb <a/255, 1, 0>]
}
scale 1/256
}
]
[(a+1)/256
pigment
{
gradient y
color_map
{
[0 rgb <a/255, 0, 0>]
[1 rgb <a/255, 1, 0>]
}
scale 1/256
}
]
#declare a=a+1;
#end
}
}
finish { ambient 1 diffuse 0 }
}
Everytime I try to start my small test scene, I get the error message "Parse
Error: expected "[", pigment found instead". Why?
See you on www.khyberspace.de !
Yadgar
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yadgar wrote:
> I'm currently trying to build a gradient y texture to generate a 16 bit
> heightfield from an isosurface terrain.
Curious: I'm just doing the opposite... ;)
> pigment // here the error occurs
>
> Everytime I try to start my small test scene, I get the error message "Parse
> Error: expected "[", pigment found instead". Why?
I think you need to get ride of the pigment{} wrapper, IIRC.
Happy landscaping!
--
Jaime
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Yadgar who wrote:
>High!
>
>I'm currently trying to build a gradient y texture to generate a 16 bit
>heightfield from an isosurface terrain. Here's the code:
I think there's a slight typo in the documentation. Where it says
each PIGMENT_BODY is anything which can be inside a pigment{...}
statement. The pigment keyword and {} braces need not be specified.
I think it possibly should say
each PIGMENT_BODY is anything which can be inside a pigment{...}
statement. The pigment keyword and {} braces must not be specified.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I'm currently trying to build a gradient y texture to generate a 16 bit
> heightfield from an isosurface terrain.
I confess I don't really understand what you are doing. Are you
trying to simulate the freaky TGA red/green 16-bit hack? Why not
just apply gradient y to the isosurface and output a 16-bit PNG
using +FN16 or Bit_Per_Color = 16?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yadgar nous apporta ses lumieres en ce 2007/07/22 04:44:
> High!
>
> I'm currently trying to build a gradient y texture to generate a 16 bit
> heightfield from an isosurface terrain. Here's the code:
>
> #declare HF16 =
> texture
> {
> pigment
> {
> gradient y
> pigment_map
> {
> #declare a=0;
> #while (a<127)
> [a/256
> pigment // here the error occurs
> {
> gradient y
> color_map
> {
> [0 rgb <a/255, 0, 0>]
> [1 rgb <a/255, 1, 0>]
> }
> scale 1/256
> }
> ]
> [(a+1)/256
> pigment
> {
> gradient y
> color_map
> {
> [0 rgb <a/255, 0, 0>]
> [1 rgb <a/255, 1, 0>]
> }
> scale 1/256
> }
> ]
> #declare a=a+1;
> #end
> }
> }
> finish { ambient 1 diffuse 0 }
> }
>
> Everytime I try to start my small test scene, I get the error message "Parse
> Error: expected "[", pigment found instead". Why?
>
> See you on www.khyberspace.de !
>
> Yadgar
>
>
This look like a case of "Why do simple when you can do overly complicated"
The normal way to do it is to add hf_gray_16 in the global_settings{...} block:
global_settings{hf_gray_16}
Then, you set a simple white to black gradient for your object:
texture{pigment{gradient y scale YourOnjectThickness}finish{ambient 1 diffuse 0}}
Adjust the scaling acording to your object thickness.
Lastly, set your output format to TGA:
Add +ft to the command line.
It will show in black and white in the preview. The output file will be black,
red and green: general hight as red component, high resolution, small scale,
hight as green.
--
Alain
-------------------------------------------------
Why do psychics have to ask you for your name?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
46a32b38$1@news.povray.org...
>
> I confess I don't really understand what you are doing. Are you
> trying to simulate the freaky TGA red/green 16-bit hack? Why not
> just apply gradient y to the isosurface and output a 16-bit PNG
> using +FN16 or Bit_Per_Color = 16?
TGA red/green is actually a 24bits image, your trick couldn't work
Marc
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Jacquier Marc wrote:
> TGA red/green is actually a 24bits image, your trick couldn't work
Yes, but the blue channel is unused when using a TGA height_field,
while a PNG can store the 16-bit in a single channel. But of course
Alain was right in pointing out that hf_gray_16 is the way to go as
it also forces gray output. Not sure what happens when you create a
height_field based on a PNG file with three channels of 16 bit each.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in a pigment_map ..don t use pigment statement ..just write your gradient
and color map ...
in a texture_map don't use texture statement etc....
web.46a318d48aa1d48566bd28430@news.povray.org...
> High!
>
> I'm currently trying to build a gradient y texture to generate a 16 bit
> heightfield from an isosurface terrain. Here's the code:
>
> #declare HF16 =
> texture
> {
> pigment
> {
> gradient y
> pigment_map
> {
> #declare a=0;
> #while (a<127)
> [a/256
> pigment // here the error occurs
> {
> gradient y
> color_map
> {
> [0 rgb <a/255, 0, 0>]
> [1 rgb <a/255, 1, 0>]
> }
> scale 1/256
> }
> ]
> [(a+1)/256
> pigment
> {
> gradient y
> color_map
> {
> [0 rgb <a/255, 0, 0>]
> [1 rgb <a/255, 1, 0>]
> }
> scale 1/256
> }
> ]
> #declare a=a+1;
> #end
> }
> }
> finish { ambient 1 diffuse 0 }
> }
>
> Everytime I try to start my small test scene, I get the error message
"Parse
> Error: expected "[", pigment found instead". Why?
>
> See you on www.khyberspace.de !
>
> Yadgar
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |