OpenGL Mix4colors 1.05
OpenGL Mix8colors 1.05 beta

Clement Mallard
clementmallard@gmail.com


I recommend you use OpenGL Mix4colors if you don't need the extra layers of OpenGL Mix8colors.
(see the known bugs section)
If the shader appears invisible, use OpenGL Mix3colors in the compatibility directory instead.
I recommend you use it if you don't need the extra layers of OpengL Mix7colors.


*** Features :

- Mix textures in realtime.

- Visualize several weightmaps at the same time.

- Paint the influence of your textures in realtime.

- Use the vertexcolors as clusters and modulate textures with weightmaps.


*** Known bugs :

- If you load a scene with OpengL Mix8colors connected, the viewport will be slow.
	OpenGL Mix4colors doesn't have this bug. To refresh the shader you'll have
	to change any setting from the property page and it'll be fast again.
	If OpenGL Mix8colors is active in several materials you'll need to update each
	material. Another way to fix the bug is to edit the shader compound and open
	any node inside. It will refresh the shader.
	If you use the compatibility version, OpengL Mix7colors has the same bug while
	OpengL Mix3colors doesn't.

- The first time you import OpenGL Mix8colors or Mix4colors you'll be warned that
	no texture is plugged. The warning will be orange, just ignore it.

*** How to use it :

- Set the viewport to Realtime Shaders/OpenGL.

- Import the shader compound and plug it into the RealTime output of the Rendertree.
	I recommend you use Mix4colors if you don't need the extra layers of Mix8colors.

- Softimage will warn you that no texture is plugged, this is normal.

- To plug a texture in the shader, plug the texture clip itself not the image node.
	Unlike any other shader, plug the blue link not the red one.

- To view the texture you plugged, choose texture instead of color in the property page.


*** Tips :

- To render textures blended with a vertexcolor channel use the Map lookup node,
	plug it in a Pick channel node and plug it the weight input of a regular Mix8colors.
	Plug different textures in the Mix8colors' color inputs and plug the output in a Phong.

- Try to avoid putting the OpenGL Mix8colors in a shared material like Scene_Material because
	it is a bit slower than the default realtime shader.

- To use the map lookup feature create 1 or 2 Vertexcolors.
	With your object selected go to Get/Property/Color at Vertices Map

- Vertex colors are created with a gray color by default. Paint them black before painting them.

- If the object is subdivided you won't be able to paint interactively.

- You can use the VertexColorExample tool to paint on different vertexcolors.
	In the Top view click Custom Displays then VertexColorExample to bring it.

- To use a weight map instead of a vertexcolor, create the following Ice tree :
	Get Weight Map Value (the one from the deformation menu) 
	--> RGBA to color (pick one color channel)
	--> Set Data (reference : this.Vertex_Color or this.Vertex_Color1)

	In OpenGL Mix8colors, pick the vertex color channel you are feeding from the Ice tree
	
	There's a trick to have the set data node display the right reference :
	Create a Set data, open it and type self.
	Click Explorer and select your mesh/clusters/Uv_Cluster_AUTO/Vertex_Color
	Then click Explorer again and pick Vertex_Color
	The node will be ready to use.


*** Limitations :

- OpenGL Mix7colors probably requires a Geforce 7 or equivalent.

- Don't change the name of your Vertex colors.

- You can't have transparent materials.

- 8 lights are shown in the textured mode, they can be point or infinite lights.
	You can use the headlight.

- Lights can't emit specular without diffuse.

- One of the lights can't be hidden.

- If you blend a layer with a texture it will consider it as a black and white texture
	and use the red channel.

- You can't directly use a weightmap in the shader, you'll have to feed the weightmap into
	a vertexcolor (see the tips section).

- You can't paint in the 2nd vertex color's alpha channel but you can feed a weightmap in.

- You can't paint directly in the vertexcolors' color channels with the default tools.
	If you paint blue over red, the blue will replace the red. Paint in the alpha channel
	or use weightmaps and feed them into the vertexcolor if you need textures to overlap.

- You can only plug a texture clip in the shader.