Git Product home page Git Product logo

Comments (35)

claudiomush avatar claudiomush commented on September 13, 2024 1

Only thanks to you work I'm able to build the image in attach. It isn't yet a "good" render but it is an gigantic step to. Gratefully, you have another fan (waiting for a material library).
render

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024 1

Well, as far as I am concerned, it can be closed.
I'm currently working on the "ready-to-use material library" mentionned above, but it is a long-term work, and I think we'll be able to open a new thread when I'm done...

from freecad-render.

luzpaz avatar luzpaz commented on September 13, 2024

I assume this is the code repo for pbrt v4? https://github.com/mmp/pbrt-v4

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello @claudiomush,
Yes, we can add support for pbrt v4. pbrt input format does not seem to be documented, but there are a full bunch of examples here: https://github.com/mmp/pbrt-v4-scenes
Are you skilled in Python? If so, the right way to proceed is to create a plugin in this workbench (explained here: https://github.com/FreeCAD/FreeCAD-render/tree/master/renderers). I've just created a 'pbrt' branch for such a dev, if you want to push PRs.
If you don't feel like writing this code, I can do it but I'm a bit short in time at the moment...

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hallo, Yes that repo is correct. I've a modest skill in Python but I'm unable to catch info about to select one part of subassembly of my Freecad project. Where have I to get some examples to that? I would try from the Python shell of Freecad to write an input file for pbrt or I'm wrong to do so? Be patient please starting from zero is difficult.

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,
Well, no offense intended, but I think you may be a bit short for writing an exporter. I'm gonna write the plugin, it just may take a few weeks, due to my present lack of time...
Just a drawback with pbrt-v4: unfortunately the dev decided to remove Disney shader support (which existed in v3...), while we use it quite intensively. The dev has not explained how to translate previous v3 Disney material to new v4 shaders, although the question is asked in an issue (mmp/pbrt-v4#4). We may be able to find some kind of workaround, but the result may still be a little disappointing for this material.

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hallo, really I'm do "short" for writing an exporter, so no offense at all. Anyway I'd like to know the process, even if long and complex and this could be interesting not for me only. Thanks for any news and... progress. Where could I catch infos about "Disney"?

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

The process to write an exporter (a "plugin") for FreeCAD Render is described here. You may also take advantage of looking at existing code for the already supported rendering engines, in renderers subdirectory here. Roughly, the exporter is a translator from FreeCAD internal objects to renderer's Scene Description Language (SDL).

Disney shader is a versatile and artist-friendly material, widely used in computer graphics, and standardized by... Disney. You may find some info about it in the following links, for instance:

...but also by searching the web with 'Disney shader' keywords.

Good luck!

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Following your suggestion I wrote inside my .FreeCad a template, actually void, and an icon, horrible indeed. For a renderer I modified the Luxcore.py which I believe close to Pbrt. My attempt was to write a not temporary input file for pbrt, without results at the time, just to verify what I'm doing. I think my binding was unable to launch pbrt as render, I'm no sure, but I'm trying.
Thanks for Disney, a new world of shaders for me.

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,
Following our exchange, I've added a plugin for pbrt v4.
It does the job but please note that, from my point of view, it is not fully functional due to those several limitations from pbrt at the moment:

  • No Disney material (quite surprising: it's been removed from v3 to v4!)
  • No Sun-sky lighting support (there's a sort of workaround by generating an image map in an helper tool, but not very handy)
  • Image-based lighting limited to square images (I did not manage to find any square HDR on web!)
  • Batch-mode by default (there is a progressive mode, but you need to pipe with tev, not very handy)
  • Denoiser in a separate tool
  • Last version of CUDA (11.3) not supported...

I don't blame pbrt, as it is not intended as a general public rendering tool, but as an educational support for rendering engine development. But for our needs in FreeCAD, it will not be sufficient, I think.

So I end pbrt plugin development at this point.

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hello,
I'm a bit surprise for this speed. It's amazing even with limits you saw; I prefer to see your work as a start becoming better in a future. Now how can I try this new toy?
Best regards

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hello, my first try was probably wrong because I got a sum of errors in console.
So the second attempt was using a single object. All steps flows plainly but where I can catch the result?

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,
Could you please join your FreeCAD files (your first try, and your single object one)? I'll try to have a look...

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,

Could you please attach your second file (single object)? It would be much easier for me...

For the first file, if it is too heavy to attach here, maybe you can create a repo in github and upload the file?

Thanks in advance

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hello, created a repo named models, at now private. Inside there's a little assembly, starting with as4... but as single model you could get "Pettine_lungo" as try. If the private mode is a visibility problem please tell me how to do.
Thanks

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello, it's allright, I have access to your repo. I'll have a look this week-end.

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

It seems that your model lacked a render project (please refer to documentation).
I created one, in 'as4_dima_crimp', and I can get an output as expected:

PbrtProjectgto5_lih

I committed and pushed my modifications to your repo, just tell me if it works for you.

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Great!. In may attempt I'm unable to see "Model@PbrtProject" that's in you one. How to do that? My pbrt runs, if I use the pbrt file pinched up from /tmp an image was produced. So I'm wrong something in Freecad but I don't know where.
I'll try to make a movie of my steps the I''l put it in repo, in case you would tell me if correct.
Screenshot at 2021-05-29 19-17-29

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hello, following your suggestion I'm able now to tender at least a simple object. There is anyway something of strange because even assigning a metal as inox I get only glass render. I attach a grab of Freecad and an sample of the pbrt file generated in tmp.
Screenshot at 2021-05-29 20-52-22
Screenshot at 2021-05-29 20-53-23

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Nice!
The problem with the material is that the Rendering section of the standard FreeCAD materials is not populated. So what you see is actually a default material. You can edit the material rendering settings with the 'Edit Material Render Settings' action in the toolbar.
I'm thinking about how to create a library of render materials.

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Just a side note: if you want your PointLight, AreaLight and Camera to be taken into account in your rendering, you must create a View for each of them in your Rendering Project.

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Again precious suggestion; would you add them to workbench README? A library of materials would be a popular benefit so I ask myself where to catch, possibly, some sources. Coming back to define a material property: are they any specs about what freecad ask for?

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Nice!
The problem with the material is that the Rendering section of the standard FreeCAD materials is not populated. So what you see is actually a default material. You can edit the material rendering settings with the 'Edit Material Render Settings' action in the toolbar.
I'm thinking about how to create a library of render materials.
How about a spreadsheet, just to try if flexible enough?

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Everything about materials here: https://github.com/FreeCAD/FreeCAD-render/blob/master/docs/Materials.md and in FreeCAD documentation...

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

I'm unable to edit any material inside Materials. I'm a bit confused: are the visual properties under [Graphical] or under [Rendering]? It seems they aren't kept after addition and anyways the aren't visible on rendering. How to try a passthrough definition to shot inside pbrt?

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,
To avoid long explainations, I've added some materials (and lights) to your test model in your repo, as an example. Some of them are "passthrough".
You should be able to get such a rendering:
PbrtProjectgto5_lih
To answer your question: the rendering parameters should be under [Rendering] in the material card. But none is not populated at the moment, this should be the goal of a rendering material library, see my post before. So you have to fill it in FreeCAD and it is not persistent in the material card.

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Nice picture, what I was searching for. I'll try to write something for example a table of common materials for a cut&paste "pbrt passthrough".
Screenshot at 2021-06-06 15-52-39

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Wow, really nice! Could not imagine pbrt was capable of such renderings.

Yes, definitely, next step will be a ready-to-use material library for rendering.

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello @claudiomush,
Would you mind sharing your above model please, for instance on your repo? It appears to be a nice use case, from my point of view, and I would like to have it in my test models...
Many thanks in advance!

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hello, I'm happy you like the model. That's a new application for H.E. physics at this time under patenting, so I'm reluctant to put it in a repo. Let me ask to my boss if possible. Making practice with lights and materials I'm going to new results as the following. Now the only running materials are by "passthrough" and I can't manage "imagelight" yet but pbrt is very powerful so it's a pleasure to play with. Thanks to you for this good binding, I hope you will commit it so other people be able to test it.

render-21006111112

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,
Thank you for your answer. If there is any license issue, please ignore my request!
To my understanding, Imagelight is limited in pbrt, as you can only use a square image (I could not find a single square HDR on the web).

from freecad-render.

claudiomush avatar claudiomush commented on September 13, 2024

Hello, in this site https://www.gitmemory.com/shadeops is mentioned the why pbrt uses a square map and the usage of "imgtool makeequiarea" to convert it in ...? Maybe useful for you?

from freecad-render.

howetuft avatar howetuft commented on September 13, 2024

Hello,
Yes, good catch! I didn't know this subtle detail, thank you.

from freecad-render.

luzpaz avatar luzpaz commented on September 13, 2024

what's the status of this ticket?

from freecad-render.

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.