Shree
12-11-2006, 07:35 AM
Following on from my request for help with 2-sided lighting in GLSL I am now implementing a CLUT so that I can modify the colour scheme of the visualization using the shader without needing to relaod the scene geometry from memory.
From Reedbeta's feedback I now realise that I can do this using the fixed-function pipeline (via glMaterialfv). However, I would like to try implementing the same functionality in a shader as an exercise in shader programming.
However, as before, I am unsure exactly how to go about this.
From what I have read, one approach is to use the 8 texture co-ordinates available to vertex shaders to specify a colour code which is used to "look-up" a colour in a fragment shader containing a CLUT.
Is this correct ? Do you know of any examples (online) which use this method ?
From Reedbeta's feedback I now realise that I can do this using the fixed-function pipeline (via glMaterialfv). However, I would like to try implementing the same functionality in a shader as an exercise in shader programming.
However, as before, I am unsure exactly how to go about this.
From what I have read, one approach is to use the 8 texture co-ordinates available to vertex shaders to specify a colour code which is used to "look-up" a colour in a fragment shader containing a CLUT.
Is this correct ? Do you know of any examples (online) which use this method ?