Skip to content

Implement SubstrateMaterial #34

@wahn

Description

@wahn

The test scene assets/scenes/ganesha/ganesha.pbrt uses a substrate material:

$ rg substrate assets/scenes/
assets/scenes/ganesha/ganesha.pbrt
38:    Material "substrate" "texture Kd" "tmap" "color Ks" [0.04 0.04 0.04]

On the C++ side we have this class:

// SubstrateMaterial Declarations
class SubstrateMaterial : public Material {
  public:
    // SubstrateMaterial Public Methods
    SubstrateMaterial(const std::shared_ptr<Texture<Spectrum>> &Kd,
                      const std::shared_ptr<Texture<Spectrum>> &Ks,
                      const std::shared_ptr<Texture<Float>> &nu,
                      const std::shared_ptr<Texture<Float>> &nv,
                      const std::shared_ptr<Texture<Float>> &bumpMap,
                      bool remapRoughness)
        : Kd(Kd),
          Ks(Ks),
          nu(nu),
          nv(nv),
          bumpMap(bumpMap),
          remapRoughness(remapRoughness) {}
    void ComputeScatteringFunctions(SurfaceInteraction *si, MemoryArena &arena,
                                    TransportMode mode,
                                    bool allowMultipleLobes) const;

  private:
    // SubstrateMaterial Private Data
    std::shared_ptr<Texture<Spectrum>> Kd, Ks;
    std::shared_ptr<Texture<Float>> nu, nv;
    std::shared_ptr<Texture<Float>> bumpMap;
    bool remapRoughness;
};

We have to implement the Rust counterpart ...

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions