//
// Copyright Contributors to the MaterialX Project
// SPDX-License-Identifier: Apache-2.0
//

#ifndef MATERIALX_HWSURFACENODE_H
#define MATERIALX_HWSURFACENODE_H

#include <MaterialXGenHw/HwImplementation.h>

MATERIALX_NAMESPACE_BEGIN

/// Surface node implementation for hardware languages.
class MX_GENHW_API HwSurfaceNode : public HwImplementation
{
  public:
    HwSurfaceNode();

    static ShaderNodeImplPtr create();

    void createVariables(const ShaderNode& node, GenContext& context, Shader& shader) const override;

    void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;

    virtual void emitLightLoop(const ShaderNode& node, GenContext& context, ShaderStage& stage, const string& outColor) const;

  protected:
    /// Return the name of the BSDF input on the node.
    virtual const string& getBsdfInputName() const;

    /// Return the name of the EDF input on the node.
    virtual const string& getEdfInputName() const;

    /// Return the name of the opacity input on the node.
    virtual const string& getOpacityInputName() const;
};

MATERIALX_NAMESPACE_END

#endif
