View topic - Updates


Ask here your questions about development and about raytracing theory & implementation. Here you can post your patches for review.

Re: Updates

Post Mon May 01, 2017 5:29 pm

Unless I'm wrong, in my understanding what the and the "end" integrators such as directlight are doing is similar to the following example I just wrote:

Code: Select all
#include <iostream>

class class1
        virtual void printNameChild() = 0;
        void printName()

class class1child: public class1
        virtual void printNameChild() { std::cout << "This class is class1child" << std::endl; }

int main()
    class1 * object = new class1child;
    return 0;

If you compile this with:
Code: Select all
g++ -o inheritance

when you execute it you should get this message:
This class is class1child

As you can see in this example, within the class1 printName() member function I'm calling printNameChild() without specifying an object. In fact, this originates from class1child who executes it's parent printName() function (not redefined in the child) which in turn executes the child printNameChild() function.

I hope this helps. I could be wrong, of course but this is how I understand it.
User avatar
David Bluecame
Posts: 401
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Updates

Post Tue May 02, 2017 6:19 am

This helped a lot. Quite a puzzle. I guess, in C it would've been implemented something like

Code: Select all
switch (integrator)

{   case directLighting: ...

    case photonMapping: ..., etc.

Probably, would've been easier on the brain.

Posts: 49
Joined: Fri Jan 13, 2017 10:43 am


Return to Developers' Corner

Who is online

Users browsing this forum: No registered users and 5 guests