Giter Club home page Giter Club logo

Comments (2)

Mike-Leo-Smith avatar Mike-Leo-Smith commented on May 25, 2024

Hi, @why986

To implement a new camera, you would need to create a new plug-in and override the following abstract method in the base Camera class:

[[nodiscard]] virtual std::pair<Var<Ray>, Float /* weight, typically set to 1 */>
_generate_ray_in_camera_space(Expr<float2> pixel /* the pixel on the film, with the upper left pixel being (0, 0), lower right (width, height) */,
                                  Expr<float2> u_lens /* 2D uniform random number for lens sampling */,
                                  Expr<float> time /* time, possibly for temporal effects */) const noexcept = 0;

which is responsible for generating a ray in the camera space. The base Camera class will invoke the overridden implementation and handle other things (e.g., filter sampling, camera transform).

The camera space is a right-handed orthogonal space, with the camera at the origin, the x-axis pointing to the right, y up, and z backward. For example, a ray from the camera to the center of the film will be origin = (0, 0, 0), direction = (0, 0, -1).

from luisarender.

why986 avatar why986 commented on May 25, 2024

Hi, @Mike-Leo-Smith
Thanks for your instruction! I will have a try on it.

from luisarender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.