# The Industry's Foundation for High Performance Graphics

1. ## assembler problem... and...

well well well, back online eh?

i was starting to miss u

now let's get back to businnes, shall we?

I am tring to write a v/f program capable of adjusting exposure values into a scene. So i have a "luminance" cubemap which must be processed. My idea is to pass to the v prog the exposure value, compute the result, pass all the stuff to the fp and then modulate the lit color with eventual textures.
Cutting with the details i need to say to the vp:

pixel_color*=2^(exposure+2,47);
pixel_final_color=pixel_color^(1/gamma);

1/gamma is 0.4545, so in my vp i say:

PARAM exposure = program.local[0];

#some temp vars...
TEMP m_exp,t_exp,temp_inColor;
#this should be a single float replicated 4 times into m_exp, and the value should be 2^t_exp.x;
EXP m_exp, t_exp.x;
this is the pixel_color*=2^(exposure+2,47);
MUL temp_inColor, inColor, m_exp.xxxx;

#now these should be the gamma corrected rgb values
#r=r^0.4545;
#g=g^0.4545;
#b=b^0.4545;
POW outColor.x, temp_inColor.x, 0.4545;
POW outColor.y, temp_inColor.y, 0.4545;
POW outColor.z, temp_inColor.z, 0.4545;

so why the program returns an error into the POWs? where am i wrong? I am just sayng that he has to change just one component a time, exponating the right comp everytime...

anyone can help?

thx all the Gunslinger

2. ## Re: assembler problem... and...

hi i kinda solved the POW problem, i had to remove the constant from the line, putting the very same value into a PARAM:

PARAM one_over_gamma = {0.4545,0,0,0};

why I can't use a numeric value into a POW?
now i have a final product to do, and guess what? i am stuck... i have declared a second PARAM:

PARAM middle_gray = {0.18,0,0,0};
MUL outColor, outColor, middle_gray.x;

it should make something like:
outColor.x*=0.18;
outColor.y*=0.18;
outColor.z*=0.18;

but surprize... it just returns an error...
why?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•