0 like 0 dislike
88 views

I'm trying to find out what surface type is below each particle and while reading I found that popcorn has a function called scene.unpackSceneSureface(). Now as shown in the image below for some reason I get an error when using it as shown in the documentation, the same issue comes from scene.unpackSceneDist(). However, scene.unpackNormal() works fine. So my question is does anyone know what I'm doing wrong or if I'm missing something? 

asked by Jamesking96 (900 points)

1 Answer

1 like 0 dislike
 
Best answer

Hi,

this is an error in the documentation, it's now been fixed.
The proper functions to use are:

float3 nml = scene.unpackNormal(hit);
float sd = scene.unpackDist(hit);
int st = scene.unpackSurfaceType(hit);

Thanks for the report !

answered by Julien (31.3k points)
Hi,

Thanks for letting me know about this. However, Even with this change, I'm getting the same error. Any other ideas as to why this is happening?

Error message:
        Error: L_14: Unresolved symbol: "unpackSurface(1)"

Code:
function void    Eval()
{
   
    int4 hit = scene.intersectExt(
        Position, //StartPoint
        -scene.axisUp(),//DirectionToFire
        RaycastDistance);//MaxDisCanTraval   
       
    float3 nml = scene.unpackNormal(hit);
    int st = scene.unpackSurface(hit);
}

Edit: The issue only happens with scene.unpackSurface()
damn, my bad, it's 'unpackSurfaceType', not 'unpackSurface'. reply updated.
Thank you for your help <3
...