Programming rendering with my own raytracing

104 views
Skip to first unread message

kalon...@gmail.com

unread,
Jan 19, 2018, 3:37:46 AM1/19/18
to Python Programming for Autodesk Maya
Hi everyone,

I’m beginner in maya API.
I would like to control the rendering block in maya
And create Physically based rendering for global illumination.
Algorithmically I knew what to do but I don’t knew how to control it.
All the tutorials I found don’t explain about
The rendering and it seem there is default option in maya of the rendering.
I want to learn the basic thing of this rendering.

Could someone explain me with some short tutorial or code how by given scene: objects, light sources and camera(pos,lookAt,camUp,fov,etc), find the intersection
And return me the value according to the rendering equation:
cos(alpha) /r^2
Where alpha is the the angle between the light source ray to the intersected point and the normal of the intersected point of the object, and r is the distance between the light source (let’s assume this time point source) and the intersected point.
save it in array and display it as a picture.
(There is also the bsdf but for now it’s not necessary)

I’m beginner so if it’s not too much, a step by step would help me very much even for trivial steps in programming in maya API.

I’ll create the objects and sources manually in maya and then I want to run my program.

Note:
Don’t give me built in rendering functions, I would like to do it myself even if global illumination exist. There is additional extension I’ll do and this is just a request for the basic.


Haarm-Pieter Duiker

unread,
Jan 19, 2018, 11:33:49 AM1/19/18
to python_in...@googlegroups.com
Hi,

There are Python-based integrations for PBRT and Mitsuba that you could use as a starting point for integrating your Renderer on GitHub here:

The PBRT integration is more recent and more complete, so would be the better starting point. 

HP



--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b66d1ba7-efc9-4ca8-994f-561dcf3d4880%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kalonimusm

unread,
Jan 20, 2018, 12:45:20 PM1/20/18
to Python Programming for Autodesk Maya
thank you, I'll check it.
however, I try to extend this plug-in,
in the github I dont see an access to the functions from the plug-in
but only an installation.
is there anyway I'll get acess for the functions and make an
extensions or I have to do all the PBR in my own?


בתאריך יום שישי, 19 בינואר 2018 בשעה 18:33:49 UTC+2, מאת Haarm-Pieter Duiker:

Haarm-Pieter Duiker

unread,
Jan 20, 2018, 1:26:16 PM1/20/18
to python_in...@googlegroups.com
All the source lives in the github repo here:

The main renderer integration methods are here:

The simple wrappers for the lights and materials defined by the renderer live here:

And so on...

HP




> To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7a31a740-beae-4d2d-bf48-6661e49809e6%40googlegroups.com.

kalon...@gmail.com

unread,
Jan 21, 2018, 6:50:22 AM1/21/18
to Python Programming for Autodesk Maya
Hey HP,

I see you are the author of the plug-in.
so first of all, thank you very much on the contribution for maya
and thank you for the reply.
second, I try to read the code over and over again
and I'm very sorry if I missed it but
the functions that I can see in the rendering folder contain a lot of
initialization and setting (getAttr,addAttribute,addSettings) but I cant see the algorithm section itself...
for example:
where is the casting ray from the camera?
where is the intersected object?
where is the rendering equation?
where is the light source sampling?
what lines are they?

I cant find it and I searched it several times.
I understand that it is divided into modules such that the main
is the renderer, the material suppose to be the specular, diffuse
or other BSDF and so on which is great but in the renderer I cant
find "the main algorithm".

I am familiar with PBR book and I'm familiar with python language.
I am new in maya, currently I've read the maya API guide and
I've created some simple plug-ins.
Now I try to control on the rendering section for my research.
actually, I've implemented basic physically based rendering by my own
and now I want to do it in plug-in of maya and I prefer to use the current
PBR algorithm for reasons of efficiently (KD-tree for example) and extend it
for my purposes.

if you can help me understand, it would be very helpful.

בתאריך יום שבת, 20 בינואר 2018 בשעה 20:26:16 UTC+2, מאת Haarm-Pieter Duiker:
> > To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
>
> >
>
> > To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b66d1ba7-efc9-4ca8-994f-561dcf3d4880%40googlegroups.com.
>
> >
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Haarm-Pieter Duiker

unread,
Jan 21, 2018, 11:13:19 AM1/21/18
to python_in...@googlegroups.com
Hi,

The two plugins I pointed you to are meant to trigger standalone renderers, like Mitsuba and PBRT, from a Maya scene. You mentioned that you had written your own renderer, so that seemed relevant. These plugins specifically do not include the renderer implementation that would cover the rendering equation, ray intersection, light source sampling, etc. They provide a way to feed data from Maya to standalone renderers that handle those calculations.

The core of each of the plugin's interaction with the renderer is the 'exportAndRender' function, like this one:

When the user hits the Render button in the Render View, the basic operations that take place are 1) export a version of the scene in the file format understood by the renderer, 2) render that exported scene as a separate process and 3) show the results of the render in the Render View.

If you're looking for c++ level integration of renderers, this repo is a good starting point
These are rendering plugins, not renderers, much like my plugins.

If you're looking for guidance on implementing renderers, looking at the PBRT source is a good starting point

HP





> > To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

>
> >
>
> > To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b66d1ba7-efc9-4ca8-994f-561dcf3d4880%40googlegroups.com.
>
> >
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/855b1878-9a6f-4c2c-856a-a24bf448071d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages