RenderMan & RISpec >> [Newbie Question] Initializing a shader..

by shpyo » Tue, 07 Oct 2003 17:19:34 GMT

Hello.

Currently, I'm implementing a light shader which needs some
preprocessing.
I coded it in the shader and it is performed every time when the light
shader
is called. So, I want to know if there is a method to let the
initializing(preprocessing) code be performed only one time.

Thank you in advance.

RenderMan & RISpec >> [Newbie Question] Initializing a shader..

by Petr Lobaz » Thu, 09 Oct 2003 16:37:34 GMT


Hi,
if I remember it correctly, light shader is divided into two parts -
illuminate and the rest. The only code that is executed in a loop is the
illuminate block. The rest of the code is executed just once. So - put
the preprocessing outside of the illuminate and you should be happy.

Petr

Similar Threads

1. image processing filters and pixel shader - newbie question

hi I am learning to use pixel shader to do digital image processing on
large scientific images. What I am doing right now is to load a huge
texture into GPU and write pixel shader programs to process it.

Quesitons:
1. Is it true that the texture size is limited by video memory? I am
loading large images that contains easily 100M+ pixels (each pixel
contains 3 channel 32-bit float). The problem is I can not load only a
part of the image into video mem. The algorithm I am working on is a
"local" processor that will cause different result if I load the
images piece by piece.

2. I can only make a vertex shader to rescale/resample the large image
to screen size. Is there any way to process a texture withotu
displaying it? Is the image size limited by screen size? I really need
to work on the individual pixels, not a rescaled image.