THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/03/2005 at 12:16, xxxxxxxx wrote:
I wish. 
This is definitely a complex problem with regards to C4D. My procedural shader nodes are all working splendidly (with the exception of the AM TexGroup preview not updating - no big deal if I get everything else, including renders). But C4D seems to treat 'shaders' and 'textures' differently. As long as the shader nodes are procedural, the results are as expected. But the two nodes which take texture images are not being properly handled, even with InitTexture, FreeTexture, and Sample.
I've tried the BaseBitmap approach, which properly displays the texture in my Node-Editor dialog, sometimes in the AM, and in the renderer (but horridly - no sampling). Sampling by hand of the texture in the node doesn't seem to work for the most part. And, of course, none of the Sampling in the TexGroup appears to be working here either.
I've tried the BaseChannel approach (described in a previous Topic) which doesn't display anywhere. It is as if the BaseChannel.InitTexture() and .FreeTexture() calls in the Shader are not handling this properly (there is no TexGroup and the BaseChannels are in the shader nodes, not the ShaderData (ala BitmapDistortionShader.cpp). I found that if these are called at the Node Preview (in the Node-Editor) level, then they are displayed properly there, but still not transmitted to Shader.Output(). The only alternative for Output() seems to call InitTexture() and FreeTexture() in each Output() call (for every pixel!).
My experience with Shaders is still insufficient. One would think that Output() calls with a proper BaseChannel would allow BaseChannel.Sample() to return good values (I'm only considering Color values at this time). Something is definitely not connecting between the ShaderData.Output and the shader node BaseChannel.Sample.