What I need to do is controlling the color map used to show a texture.
Best solution: users input a number of colors and the shader makes his best effort to approximate all pixel colors to that color map. So that the final texture is rendered with just the number of colors defined by the user.
User’s input can be a Value or a ColorSpread.
Anybody has a clue or wants to develop this?
My shader/coding skills are too low to make this by myself…
Unfortunately Kalles’s latest CelShader is not sufficien, because it hasn’t such a good control of color depth.
For now I can do it with 2 colors, thanks to the 3rd pixelshader for newbies example :D you can find it in attachment, just load a filetexture.
the Cel-Shader for now is just a proof-of-concept and the color quantizing feature is just meant as a gimmick…
if i had been 100% confident with it, i already would have had posted it to the user shaders like elemeier already demanded…
*User’s input can be a Value or a ColorSpread.
+possible, but FWIK the spreadcount of User’s input must be predefined within the shader.
+if a variable is possible here i would be very thankful for advice.
+should somehow look like
#define ColCount 6
float4 UserColColCount: COLOR ;
*and the shader makes his best effort to approximate all pixel colors to that color map.
+one would need a more precise definition of how to approximate the unknown count of user’s reference colors.
assuming that those users’s colors are NOT dispersed evenly it will not be possible to use the same tolerances for all user colors.
Thanks cat, nice shader! Btw I can’t control a lot with it…anyway I’m trying to work with RGB distance, without shader…but for now I think only greyscale is working really fine, need to experiment more with colors. Best would be a 4Bit(Color) node or 4Bit.fx shader ;)