Sampling Shader



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

    On 03/01/2007 at 12:16, xxxxxxxx wrote:

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

    ---------
    Hi all,

    i need info to sample the shader in the correct way.
    SLA, for example, can use 3D coord or UVW coordinate.
    in SLA there is the texture projection type for this.

    The shader sampling need a ChannelData. ChannelData have ->p for the UVW coordinate and a ->vd for the rest.
    I thought that was possible to put the UV in the cd.p and the 3D coordinate in cd.vd.p then if the shader need a volumetric projection, it get from vd the correct coordinate.. but it's not working.. seem that it always get the 2d or 3d coordinate from the cd.p.

    Someone have info about this?

    Thanks in advance
    Renato



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

    On 05/01/2007 at 04:27, xxxxxxxx wrote:

    Hi Renato,

    the Sample function you use is for sampling the cd->p value. You should probably use BaseChannel::Sample maybe? I haven´t tried it, but I cannot find anything else for sampling 3d data. There you can also pass the volumedata, so it should work.

    Let me know if it does, I would also be interested :-)

    Hope it helps
    Happy new year Renato
    Samir



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

    On 06/01/2007 at 05:46, xxxxxxxx wrote:

    Hello Samir,

    I don't use BaseChannel::Sample but PluginShader::Sample.
    Will be good to have secure informations from maxon. I hope that tomorrow someone will reply to my open question.
    If i pass the VD to che CD.. nothing change. The PluginShader (SLA) use always the cd.p for both 3D or 2D coordinate.

    Happy new year to you :)
    Renato



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

    On 06/01/2007 at 14:40, xxxxxxxx wrote:

    But you SHALL use BaseChannel::Sample INSTEAD OF Pluginshader::Sample, because PluginShader::Sample is the sampled point in cd->p! And BaseChannel::Sample is the only alternative I see. :-)

    PluginShader::Sample will always give you the result of cd->p, passing vd won´t help, because it´s for ChannelData calculations, not for 3D shader calculations as the docs clearly state.



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

    On 06/01/2007 at 16:17, xxxxxxxx wrote:

    Interesting, but how i can get BaseChannel from my custom material?

    Cheers
    Renato



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

    On 07/01/2007 at 06:45, xxxxxxxx wrote:

    If it´s your own material you could use your own code for sampling I´d assume? Would also be faster than calling an SDK function.

    However, you get the channel of a plugin material with BaseMaterial::GetChannel(NULL);



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

    On 07/01/2007 at 06:52, xxxxxxxx wrote:

    Hello Katachi,

    ok, but i've some channel inside, Diffuse, Specular, Lighting, Mirror, Glass etc. :)

    How i can get the correct basechannel if i point it with null?

    Can i cast it from plugin shader.. maybe.

    Cheers
    Renato



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

    On 07/01/2007 at 09:49, xxxxxxxx wrote:

    Hello Katachi,

    i done some try.. and BaseMaterial::GetChannel is return always NULL with GetChannel(NULL) or GetChannel(IDofMyShaderLINK).

    Any Help?

    Cheers
    Renato



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

    On 07/01/2007 at 12:29, xxxxxxxx wrote:

    It seems that it only works with normal materials. (I misunderstood the description). Does it work for "normal" 3D materials, like the SLA shaders?

    For your own materials you need to do your own sampling most probably (although I think there must be a way to sample...but the support is terrible here at the moment)



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

    On 07/01/2007 at 13:53, xxxxxxxx wrote:

    Thanks anyway Katachi,

    i'm sure that there is a standard way to sample a c4d shader :) I'm sure thant Tomorrow someone will help me to close this job :)

    Cheers
    Renato



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

    On 07/01/2007 at 19:43, xxxxxxxx wrote:

    Let´s hope so. I also would like to know. :-)



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

    On 08/01/2007 at 09:12, xxxxxxxx wrote:

    .. i hope that from today the maxon support will be operative... :)

    Cheers
    Renato



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

    On 11/01/2007 at 11:45, xxxxxxxx wrote:

    Sorry for the delay. Shouldn't that be GetChannel(CHANNEL_COLOR) and not GetChannel(NULL), if your plugin shader is in the color channel for example? Then you should be able to use BaseChannel::Sample(), I think. As Katachi says, this is the only function that will allow you to sample an arbitrary point.



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

    On 11/01/2007 at 11:51, xxxxxxxx wrote:

    Hi Mikael,

    It work also with a Custom Material?

    Cheers
    Renato



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

    On 11/01/2007 at 12:06, xxxxxxxx wrote:

    No, for PluginMaterial (if that's what you mean) there are only the BaseMaterial sampling functions, afaics, for example CalcSurface().



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

    On 11/01/2007 at 12:33, xxxxxxxx wrote:

    Mikael,

    i only need to sample shader color of each custom "channel".

    There is a Vray Material with some shaderlink inside.
    Some for diffuse, some for specular, mirror, glass etc.

    I see that there are no problems to sample each shader linked in it.. but i need to know how to pass and retrieve UVW or 3D coordinate to the shaders.

    Thanks
    Renato



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

    On 18/01/2007 at 00:02, xxxxxxxx wrote:

    Hm, it looks like that's a limitation of accessing the shaders directly, without access to their channels. But perhaps you could clone the shaders and insert them into dummy BaseChannels in order to call BaseChannel::Sample?



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

    On 18/01/2007 at 06:13, xxxxxxxx wrote:

    when rendering? uhm..

    let me think about it.

    Cheers
    Renato



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

    On 18/01/2007 at 12:41, xxxxxxxx wrote:

    Yeah. Preferably as a pre-step, I guess, in order not having to clone for every calculation.



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

    On 18/01/2007 at 13:47, xxxxxxxx wrote:

    yes, i need to make a copy of material... initialising then call the sample.

    Thanks for now
    Renato T.


Log in to reply