Function isSkipDrawing

  • Determines whether drawing should be skipped for a given material and primitive combination.

    This function checks if the material has a valid shader program for the specified primitive. If no valid shader program is available (indicated by a UID of -1), drawing should be skipped to avoid rendering errors.

    Parameters

    • material: Material

      The material to check for shader program availability

    • primitive: Primitive

      The primitive that will be rendered with the material

    Returns boolean

    true if drawing should be skipped (no valid shader program), false otherwise

    const shouldSkip = isSkipDrawing(myMaterial, myPrimitive);
    if (!shouldSkip) {
    // Proceed with rendering
    renderPrimitive(myPrimitive, myMaterial);
    }