Photo-realistic rendering of FreeCAD models with CADRays

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by Kunda1 »

Really cool to see this cross-pollination between two awesome projects and active community of devs. Thanks you for reaching out.
So quick apology about hijacking this thread for just a minute. FreeCAD bugtracker has several upstream OCC bugs that may or may not be on your radar. If possible at some point to take a look would be super appreciated. Thanks in advance!

BTW, CADRays looks sweet...too bad the linux port isn't available yet. Cheers!

Edit for clarity: Of course I'm just referring to the Upstream tickets that need to be bumped list. No expectation for you folks to check the bugs on FreeCAD :oops:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by DeepSOIC »

Does CADRays support refraction, and is it possible to ray-trace some optical stuff?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by DeepSOIC »

Just gave it a try. First impressions not great. But interesting.

It seems to not like touchscreen input. When I tap on scene to select object, it takes two taps. As soon as I tap on material, selection is lost and material box becomes empty.

After a few minutes of me playing around, my computer slowed down to become absolutely unusable, across the whole system. CPU usage was low, so I assume that graphics card may have been swamped with data or processing, or maybe it simply overheated.... I don't know. Closing CADRays brought it back to life, instantly.

I can't type to "TCL Console", and can't select any text in it. It says:
info.png
info.png (62.56 KiB) Viewed 3641 times
OS: Windows 10
Word size of OS: 64-bit
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by DeepSOIC »

Hey, RTFM helps a bit. Still fighting with UI...
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by DeepSOIC »

Tried some optics! Not very impressive, but something!
https://forum.freecadweb.org/viewtopic. ... 70#p165770
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by NormandC »

@DeepSOIC
Integrated Intel HD Graphics are a bad joke compared to real discrete graphics cards. It's no surprise you're having performance issues with GPU-based rendering. In this case, the bigger the GFX card the better. My former boss had bought himself a workstation with a $1500 Nvidia Quadro card just for that purpose.

I briefly tested CADRays at work today, looks promising! I just wish there were more materials (woods, plastics, ceramics etc.), but I understand that you can't spend too much energy on that. Unfortunately, at work I usually can't afford to spend the time to tweak/create materials. Finding a way for users to share their materials would be useful... For release 2.0 maybe? :D
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by DeepSOIC »

NormandC wrote:@DeepSOIC
Integrated Intel HD Graphics are a bad joke compared to real discrete graphics cards. It's no surprise you're having performance issues with GPU-based rendering. In this case, the bigger the GFX card the better. My former boss had bought himself a workstation with a $1500 Nvidia Quadro card just for that purpose.
Yep. I fired up my stationary pc which I occasionally game on. It isn't powerful by modern measures, but much much better GPU than my tablet :P . Radeon 7700. Now I'm waiting for my next optics render to go noiseless :ugeek: ... It may get there in 10-20 minutes :mrgreen:
duv
Posts: 12
Joined: Wed Mar 15, 2017 11:34 am
Contact:

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by duv »

Hi!
DeepSOIC wrote: After a few minutes of me playing around, my computer slowed down to become absolutely unusable, across the whole system. CPU usage was low, so I assume that graphics card may have been swamped with data or processing, or maybe it simply overheated.... I don't know. Closing CADRays brought it back to life, instantly.
As you already found out, you need a discrete GPU to do something useful with GPU renderer ;) . Computer slowed down because it uses the same graphic card for any screen output and there were to much work for it. It is miracle enough we can even run this code on Intel HD 4000!
DeepSOIC wrote: It seems to not like touchscreen input. When I tap on scene to select object, it takes two taps. As soon as I tap on material, selection is lost and material box becomes empty.

I can't type to "TCL Console", and can't select any text in it. It says:
Sorry, touch input is not really supported, it is planned for future releases.
DeepSOIC wrote:Tried some optics! Not very impressive, but something!
https://forum.freecadweb.org/viewtopic. ... 70#p165770
Looks awesome! :shock:
NormandC wrote:@DeepSOIC
Integrated Intel HD Graphics are a bad joke compared to real discrete graphics cards. It's no surprise you're having performance issues with GPU-based rendering. In this case, the bigger the GFX card the better. My former boss had bought himself a workstation with a $1500 Nvidia Quadro card just for that purpose.
Indeed! Although Quadro gives a little (or probably nothing) performance gain comparing to corresponding GeForce cards in this case.
NormandC wrote: I briefly tested CADRays at work today, looks promising! I just wish there were more materials (woods, plastics, ceramics etc.), but I understand that you can't spend too much energy on that. Unfortunately, at work I usually can't afford to spend the time to tweak/create materials. Finding a way for users to share their materials would be useful... For release 2.0 maybe? :D
Actually all this materials are currently possible, though for now you need to tune it yourself. For example simple wood can be done with glossy material and wood texture. Plastics and ceramics could be achieved with glossy or paint material. I think we will publish some material tutorials soon.
Strictly speaking you can share materials with TCL scripts :D . Just setup material and save scene to script then you can grab corresponding code from script file (vbsdf calls) and apply it in console. We understand it is not convenient at all and of course we will implement proper material library at some point.

Thank you all for your feedback!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by DeepSOIC »

1. Light source intensity box says "power". So I thought, it means "fixed total power". But from experience, I think it is actually fixed brightness. Because when I tweak solid angle of directional light, the scene becomes darker/lighter, and I have to compensate by increasing/decreasing "power". Same thing happened with point light: as I decreased its diameter, the total light output obviously went down.

2. Glass material has scattering color. But I would also like to see scattering coefficient. Changing scattering color didn't affect the look of glass in my renderings, but it may be because number of bounces was too low (5).

3. "Density". Doesn't seem to work. What unit is it in?

4. Please make a button to pause rendering.

5. I would love to see some tools for obtaining more physical results. For example, I would like to use this program to calculate the amount of light that hits a certain surface.

All in all, that was an interesting first dive into ray-tracing :D .
denisb
Posts: 5
Joined: Wed Mar 15, 2017 1:08 pm

Re: Photo-realistic rendering of FreeCAD models with CADRays

Post by denisb »

Thank you for your feedback! We'll try to improve UI in the next version. Please find some answers below.
DeepSOIC wrote:1. Light source intensity box says "power". So I thought, it means "fixed total power". But from experience, I think it is actually fixed brightness. Because when I tweak solid angle of directional light, the scene becomes darker/lighter, and I have to compensate by increasing/decreasing "power". Same thing happened with point light: as I decreased its diameter, the total light output obviously went down.
It seems that parameter name is confusing. In fact, underlying parameter affected by this setting is radiance (the power per unit solid angle per unit projected area, W / sr * m^2). So the final output power (in W) is scaled by this setting and depends on the area of light source (bigger light source with the same radiance emits more energy).
DeepSOIC wrote:2. Glass material has scattering color. But I would also like to see scattering coefficient. Changing scattering color didn't affect the look of glass in my renderings, but it may be because number of bounces was too low (5).
Exactly this thing is controlled by "Density" setting (again, it may be not very suitable name which was got from Blender).
DeepSOIC wrote:3. "Density". Doesn't seem to work. What unit is it in?
This is linear absorption coefficient. We use Beer-Lambert law: I = I_0 * e ^ (-alpha * x), where x is ray length inside the glass, and alpha is our coefficient. So, the intensity of light decreases exponentially with depth in the material. Linear absorption coefficient is expressed in units of 1 / m.
DeepSOIC wrote:4. Please make a button to pause rendering.
Ok, thanks for suggestion. Right now you can minimize the app in order to pause the rendering.
DeepSOIC wrote:5. I would love to see some tools for obtaining more physical results. For example, I would like to use this program to calculate the amount of light that hits a certain surface.
In fact, it is possible since CADRays uses physically-based rendering core. But, right now our main goal is visualization, not measurements. So maybe at some point we'll think about it.
DeepSOIC wrote:All in all, that was an interesting first dive into ray-tracing :D .
Thank you again!
Post Reply