Anyone know why this is happening

0 like 0 dislike
30 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 Aug 21 by Jamesking96 (470 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 Aug 21 by Julien (30,280 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
...