Sampling/AA used by C4D?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 23/03/2005 at 14:43, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.012 
    Platform:   Windows  ; Mac  ;  Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Forgot to ask this in my other thread, but I'll make a separate topic nonetheless.

    What kind of sampling/antialiasing does Cinema4D user on texture images (ala BaseChannel.Sample())? Since using BaseChannel in my node code isn't working (and there is no sampling in BaseBitmap), I'll need to create my own.

    Information appreciated! :)

    Thanks,



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 23/03/2005 at 21:12, xxxxxxxx wrote:

    What is really needed, I think, is a bilinear interpolation algorithm given (u,v). Is it easy to find one? - no. In all my books (and I have plenty) and in all my web searches, nobody has an algorithm or source to do a texture bilinear interpolation given a (u,v) coordinate.

    Anybody have one, a link to one, a reference to one???



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 24/03/2005 at 10:40, xxxxxxxx wrote:

    nope :-) Maybe darf can help. He is the texture master.



  • 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.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 24/03/2005 at 12:26, xxxxxxxx wrote:

    For illustrative purposes, let me at least show the structure to which I'm alluding as it may be very ambiguous:

      
    Material  
         Channel:Color:TexGroup  
              MyShader  
                   Channel_Node (Always exists, root node for primary Output of connected nodes' outputs)  
                   ShaderNode List (doubly-linked list of ShaderNodes, connections between nodes are stored in ShaderNodes as NodeInputs)  
                        XX_Node  
                        XX_Node  
                        ...  
                        XX_Node  
                        ...  
                        ImageMap_Node  
                             BaseChannel (initialized, pointed to image if any)  
                        ...  
      
    Sampling process:  
         MyShader.InitRender  
              for all ImageMap_Node  
                   BaseChannel->InitTexture  
         MyShader.Output  
              Channel_Node.Output  
                   recursive call through connections  
                   ...  
                   ImageMap_Node.Output  
                        BaseChannel->Sample(using ChannelData passed from MyShader.Output)  
         MyShader.FreeRender  
              for all ImageMap_Node  
                   BaseChannel->FreeTexture  
    


  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 25/03/2005 at 06:11, xxxxxxxx wrote:

    I guess the sampling method depends on what is set in BITMAPSHADER_INTERPOLATION, at least if using Xbitmap shaders in 9.1. I'm not sure if there was a similar concept of sampling bitmaps as shaders before 8.5.


Log in to reply