I have following problem: I have a 3D model using a bunch of colored textures. And I need to display the model in greyscale instead.
I thought I could use the pixel shader/register combiner for this, but I can't access the RGB channels seperately =/.

Is there any way to get this done?

Please help,

BlackJack

davepermen

07-23-2002, 10:26 PM

r*.333 + g*.333 + b*.333 is one way. thats a 3 component dotproduct.. you can do that in a pixelshader..

you can use another "grayscaler", there are documents about this.. dunno wich constant vector is the one wich adobts normal grayscale look the best.. but there are documents about this on ati.com, i remember there seen it in some pixelshader (right before the sepiafilter, wich is a brownscaler http://www.opengl.org/discussion_boards/ubb/wink.gif)

Thanks a bunch... just one problem:
I converted it to PS1.0 now but anyway the nvparse doesn't take ps.1.0 at all and I searched my to death to find the dp3 function for register combiners =/. They are able to do it... after all it's also enabled in the ps10 parse sourcecode... but what is the command for a dp3 for a general combiner? Or how else to do it in GL?

BlackJack

p.s. Doesn't matter what pixel shader code I pass, it always fails with "error in line" 0... which line 0??? =/ May be it has got problems with 0x0D and 0x0A or so?

[This message has been edited by BlackJack (edited 07-24-2002).]

Mezz

07-24-2002, 02:18 AM

In combiners, I think you get it with the "CombinerOutputNV" routines, it lets you specify where to put Dot Products.

set a to your color, b to the grayscaler, and abDotProduct to GL_TRUE, set abOutput to the resultregister

BlackJack

07-24-2002, 09:16 AM

Hm..... Any !!RC1.0 or 1.1 command reffering to this? I searched already a lot, but couldn't find it within this heavy sourcecode. I would prefer to keep everything inside scripts... ok... in worst case I'll simply add it to the parser myself... but would normally prefer to don't do any changes on nvparse.