POV-Ray : Newsgroups : povray.binaries.programming : Rendering Objects In gray scale Server Time
20 Apr 2024 02:50:10 EDT (-0400)
  Rendering Objects In gray scale (Message 1 to 3 of 3)  
From: Pablo Viojo
Subject: Rendering Objects In gray scale
Date: 31 Jan 2001 16:31:13
Message: <3a788421@news.povray.org>
I have recently downloaded the PovRay source code and try to make a little
modification to it:

I need to render a scene in a gray scale but not entirely, this is I need
some objects to render in this way while the rest of the scene renders as
it does normally. So, I thought that a good way of making this could be
create a new key to add to the objects I want to render in gray scale, let's
say "gray".

I started proofing this in a box:
1. Added to the OBJECTS_FIELD definition a new field called Gray, so it
became

#define OBJECT_FIELDS   \
  METHODS *Methods;     \
  int Type;             \
  OBJECT *Sibling;      \
  TEXTURE *Texture;     \
  INTERIOR *Interior;   \
  OBJECT *Bound;        \
  OBJECT *Clip;         \
  BBOX BBox;            \
  unsigned long Flags;  \
  bool Gray;

Then I tried to execute the program (knowing it would not do anything by
now) but when I tried to render a scene (anyone) I have an error in the
line:
if (Object->Type & LT_SRC_UNION_OBJECT)

that's in the function Post_Process called after an object is parse (a
couple of lines after the called to Parse_Object(...))

The error is "Unhandled Exception in pvengine.exe 0xC0000005: Access
Violation"

I know what it means because I have programmed for so long but only recently
started programming in c (c++).

I thought that the problem here is about how many memory povray reserve to
an Object and when I added a new field to the structure I'm having a problem
with the memory addresses.

If anyone has any suggest about this problem or about how to solve my
original problem in a best way I'm waiting for your answer.-

Thanks a lot.-

Pablo Viojo
pvi### [at] adinetcomuy


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Rendering Objects In gray scale
Date: 31 Jan 2001 21:40:46
Message: <3a78ccae$1@news.povray.org>
In article <3a788421@news.povray.org> , "Pablo Viojo" <pvi### [at] adinetcomuy>
wrote:

> I need to render a scene in a gray scale but not entirely, this is I need
> some objects to render in this way while the rest of the scene renders as
> it does normally. So, I thought that a good way of making this could be
> create a new key to add to the objects I want to render in gray scale, let's
> say "gray".

You can get the effect making the *object* gray using "rgb x".


     Thorsten


Post a reply to this message

From: Warp
Subject: Re: Rendering Objects In gray scale
Date: 1 Feb 2001 05:12:50
Message: <3a7936a2@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: You can get the effect making the *object* gray using "rgb x".

  You mean "rgb 1"?

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Rendering Objects In gray scale
Date: 1 Feb 2001 09:07:45
Message: <3A796E40.BBA1631E@pacbell.net>
Warp wrote:
> 
> Thorsten Froehlich <tho### [at] trfde> wrote:
> : You can get the effect making the *object* gray using "rgb x".
> 
>   You mean "rgb 1"?

That would be white. Thosrten meant "rgb x" as in choose a number
between 0 - .99 which will give you shades of gray.

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: Rendering Objects In gray scale
Date: 1 Feb 2001 11:24:46
Message: <3a798dce@news.povray.org>
Ken wrote in message <3A796E40.BBA1631E@pacbell.net>...
> Warp wrote:
> > Thorsten Froehlich <tho### [at] trfde> wrote:
> > : You can get the effect making the *object* gray using "rgb x".
> >   You mean "rgb 1"?
> That would be white. Thosrten meant "rgb x" as in choose a number
> between 0 - .99 which will give you shades of gray.


I think problem posted at begining of this thread was not resolved.
As I understand question (I'm poor in english) problem was how achive final
color as grey. That is complicated. Even if pigment{color rgb N}} specify gray
there is reflection, refraction, color of light_sources, radiosity - and Pablo
Viojo want it all converted to grey in part of image for objects with flag
GRAY=TRUE. I think we don't need recompile for this. All what we need is two
renderings - first normal and second with cartoonish style without AA - than (in
image manipulating program) create mask from second and apply greyscale on first
with this mask. Such effect (but inversed) is often used on movies. Whole scene
is in greyscale and one object is colorized.
I hope it was understable with my english.

ABX


Post a reply to this message

From: Pablo Viojo
Subject: Re: Rendering Objects In gray scale
Date: 1 Feb 2001 14:58:11
Message: <3a79bfd3@news.povray.org>
Thanks for your replies.

I know that just setting the rgb to an x value it's the same that rgb
<x,x,x>
which will make the object we in gray scale.

But my problem is more related to the Object structure and the way
PovRay manages the memory for the different processes.-

If anyone could tell me something about this...

I'm sorry because my english is not best too, but I try to do the best that
I
can.

Thanks a lot again.-

Pablo Viojo
pvi### [at] adinetcomuy


Post a reply to this message

From: Y Tanabe
Subject: Re: Rendering Objects In gray scale
Date: 1 Feb 2001 18:03:43
Message: <3A79EB4F.19C2E592@kh.rim.or.jp>
#define OBJECT_FIELDS   \
  METHODS *Methods;     \
  int Type;             \
  OBJECT *Sibling;      \
  TEXTURE *Texture;     \
  INTERIOR *Interior;   \
  OBJECT *Bound;        \
  OBJECT *Clip;         \
  BBOX BBox;            \
  unsigned long Flags;  \
  bool Gray;

Add bool Gray by you.
You have to check all source files,for example post_process or more.
And memory move functions and stack macro also.

Y.Tanabe
Kobe,Japan


Pablo Viojo wrote:

> Thanks for your replies.
>
> I know that just setting the rgb to an x value it's the same that rgb
> <x,x,x>
> which will make the object we in gray scale.
>
> But my problem is more related to the Object structure and the way
> PovRay manages the memory for the different processes.-
>
> If anyone could tell me something about this...
>
> I'm sorry because my english is not best too, but I try to do the best that
> I
> can.
>
> Thanks a lot again.-
>
> Pablo Viojo
> pvi### [at] adinetcomuy


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Rendering Objects In gray scale
Date: 2 Feb 2001 00:05:07
Message: <3a7a4003$1@news.povray.org>
In article <3a79bfd3@news.povray.org> , "Pablo Viojo" <pvi### [at] adinetcomuy>
wrote:

> If anyone could tell me something about this...

There should be no problem.  Adding or removing fields there will just
change a few structures, so there won't be any problems caused by this.  You
should note that the access violation is obviously a corrupted pointer and
caused by using it, not by the memory offset into the structure.  You will
not always get a access violation if you just read or write memory somewhere
except outside the virtual memory space of your program, and C0000005 looks
like some other data or an unititialised pointer.  Whatever it is, just use
your debugger to find out where that pointer is coming from.

Not related to this, but I think you should be aware of this: Adding object
fields for flags is not a good idea because it will waste a lot of memory
because the field (most likely padded in memory to make the whole structure
fill up to a 4 byte boundry) will be added to every object.  You better use
the "Flags" field for this, there should be a few bits left in there.


     Thorsten


____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Warp
Subject: Re: Rendering Objects In gray scale
Date: 2 Feb 2001 06:59:24
Message: <3a7aa11b@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: That would be white. Thosrten meant "rgb x" as in choose a number
: between 0 - .99 which will give you shades of gray.

  I got confused by the fact that "rgb x" is a valid povray color (red).

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Rendering Objects In gray scale
Date: 2 Feb 2001 09:16:34
Message: <slrn97lga3.23t.ron.parker@fwi.com>
On Thu, 01 Feb 2001 23:05:07 -0600, Thorsten Froehlich wrote:
>except outside the virtual memory space of your program, and C0000005 looks
>like some other data or an unititialised pointer.  Whatever it is, just use
>your debugger to find out where that pointer is coming from.

C0000005 isn't a pointer; it's the NT status code for an access violation.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.