Files
test/intern/cycles/subd/patch.h
Brecht Van Lommel e84b377eae Refactor: Simplify subd patch code
* Remove unused linear patch normals
* Renaming for consistency and clarity
* Shuffle order of function definitions

Pull Request: https://projects.blender.org/blender/blender/pulls/135681
2025-03-11 20:58:20 +01:00

48 lines
922 B
C++

/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
*
* SPDX-License-Identifier: Apache-2.0 */
#pragma once
#include "util/boundbox.h"
#include "util/types.h"
CCL_NAMESPACE_BEGIN
class Patch {
public:
Patch() = default;
virtual ~Patch() = default;
virtual void eval(
float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const = 0;
int patch_index = 0;
int shader = 0;
bool from_ngon = false;
};
/* Linear Quad Patch */
class LinearQuadPatch final : public Patch {
public:
float3 hull[4];
void eval(
float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const override;
BoundBox bound();
};
/* Bicubic Patch */
class BicubicPatch final : public Patch {
public:
float3 hull[16];
void eval(
float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v) const override;
BoundBox bound();
};
CCL_NAMESPACE_END