TraceColor keeps on crashing!!!



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

    On 15/04/2005 at 08:47, xxxxxxxx wrote:

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

    ---------
    Hi all

    Have been trying to write a little test with a VOLUMESHADER plugin that traces the scene and changes the current pixel colour slightly. However, the plugin seems to crash no matter how I change the code.

    My current code (in the CalcVolumetric method) centres around this snippet ...

    LONG hit;
    Vector p,n,col;

    col = sd->TraceColor(sd->ray,1000000,0,p,n,hit);

    Is this rights? Or am I missing something out?

    Cheers

    Dan



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

    On 15/04/2005 at 12:13, xxxxxxxx wrote:

    Have you set SHADER_VOLUMETRIC flag?



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

    On 15/04/2005 at 12:27, xxxxxxxx wrote:

    Yep, and the SHADER_RAYTRACING flag too.

    Could it be compiler settings? I followed the tutorial by Astrofish to set the Visual C++ project up, so that should be ok, right?



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

    On 17/04/2005 at 11:58, xxxxxxxx wrote:

    Hi

    Just out of interest, if no one knows what the problem is or if I'm being too vague, then could someone post some code that uses 'TraceColor' that definately works, please?

    Cheers

    Dan



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

    On 21/04/2005 at 13:30, xxxxxxxx wrote:

    Have you tried TraceColorDirect()? There's a sample call in Radiosity.cpp in the 7.303 SDK.



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

    On 26/04/2005 at 12:02, xxxxxxxx wrote:

    Hi Mikael

    Have tried what you suggested, but have had no luck unfortunately. I even got the Radiosity example from the 8.1 SDK and copied the main function into my code (almost word for word) and it still doesn't work! Here's my function below ...

    void VolumeTest::CalcVolumetric(PluginMaterial *mat, VolumeData *vd)
    {
         Vector col;
         LVector p, n;
         LONG hit;

    VolumeData *cpy = VolumeData::Alloc();
         //if (!cpy) return 0.0;
         vd->CopyTo(cpy); // copy vd settings into cpy

    col = cpy->TraceColorDirect(vd->ray,MAXREAL,vd->raydepth+1,vd->raybits,0,&p;,&n;,&hit;);

    vd->col = col*0.5; // return 50% of color (as an example)
         vd->trans = 1.0;

    VolumeData::Free(cpy); // free copied data
    }

    It all seems to compile fine on VC6, but when I tried to create a new shader of it in C4D8.1 the program just crashes with a stack error. HELP!!

    Cheers



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

    On 26/04/2005 at 16:06, xxxxxxxx wrote:

    check to see if vd exists.
    if (!vd) return



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

    On 26/04/2005 at 16:32, xxxxxxxx wrote:

    Ok. Will give that a go. Why would it not exist though?

    Isn't vd the current volumedata context?


Log in to reply