Giter Site home page Giter Site logo

Comments (13)

Speierers avatar Speierers commented on July 17, 2024

This is a know issue. Currently, only the Interaction<DynamicBuffer<Packet<float, 8>>> type has bindings for the packet_* variants. This will be fixed in a later version of Mitsuba 2, involving changes in to the enoki library as well.

The Custom plugin feature has only been tested with gpu_* variants of the renderer. If your machine supports it, I would strongly recommend to use the GPU variants for this. As stated in the doc, this feature only really makes sense with wavefront modes for performance reason.

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

With small corrections( final plugin class), I was able to render in scalar_* variant. gpu_rgb and gpu_spectral variants give me following error.

Traceback (most recent call last):
  File "test_light_src.py", line 40, in <module>
    scene = load_file(filename, num_bounces=num_bounces, num_samples=num_samples, resolution=resolution)
RuntimeError: ​[xml.cpp:1058] Error while loading "gelsight_model/mitsuba2_visual_illumination_model.xml" (near line 118, col 4): could not instantiate emitter plugin of type "mypoint": TypeError: Unable to convert function return value to a Python type! The signature was
[xml.cpp:1058]  (self: mitsuba.core.Properties, arg0: str) -> object
[xml.cpp:1058]
[xml.cpp:1058] At:
[xml.cpp:1058]   /home/arpit/projects/sensor_optim/myEmitters.py(24): __init__
[xml.cpp:1058]   test_light_src.py(37): <lambda>
[xml.cpp:1058]   test_light_src.py(40): <module>

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

The issue being with this line:

self.m_world_transform = AnimatedTransform(props["to_world"])

it would be intersting to print the return value of props["to_world"].

Also, two things I would like to mention here:

  1. If I remember correctly, there is a know issue with the python constructor of custom python plugin class regarding reading fields from the props object. This is on my TODO list.
  2. AnimatedTransform haven't been tested much (not at all on GPU, not sure it even works). This is also on my TODO list

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

I also checked direct_integrator.py using hello.xml with gpu_rgb. I get similar error for register_integrator as well.

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

I just tested this, it works fine for me.
Could you give me more information: compiler, OS, python version, ... and a full log so I can look into it?

Thanks!

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

False alarm regarding hello.xml. The error was because of not using xml properties in hello.xml integrator.
However, I am still getting an error for the custom emitter. For gpu_* variants, if I use python print statement, I don't see any output on the screen. How do I print the type of props["to_world"]?

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

This is the smallest scene, which I am creating.
When I query props["intensity"] in my emitter plugin cstor, I get following output

RegularSpectrum[
  distr = ContinuousDistribution[
    size = 95,
    range = [360, 830],
    integral = 3.70309,
    pdf = [0.00441316, 0.00467105, 0.00492895, 0.00482895, 0.00472895, .. 85 skipped .., 0.00491663, 0.00517598, 0.00543533, 0.00557121, 0.00570709]
  ]
]

However, it doesn't have Texture class functions like eval.
It seems to be opaquely casted into mitsuba.core.Object which these member functions only.

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

Is this in gpu_rgb mode? If it is, you should get a UniformSpectrum instead of RegularSpectrum.

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

This is probably a bug in the bindings of Properties. I will try to look into this ASAP.

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

I added bindings for ScalarTransform4f in 7599c2e which were necessary in Properties.

I was able to load a scene file with you custom mypoint emitter successfully, and the constructor seems to be read all the properties correctly now (intensity included).

Let me know if this fixes your issue.

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

My previous post was with scalar_rgb. I tried after pulling your changes with both scalar_rgb and gpu_rgb. I get UniformSpectrum[value=[1.000000]] with gpu_rgb.
Loading scene works with proper transform in both variants. However, rendering fails with custom plugin. Both spectrum don't have methods of Texture class like eval.

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

Could you try again with 53a6b96?

Thanks for reporting all those issues. This custom plugin feature hasn't been tested much so far...

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

Thanks! This does the magic. I am now able to call texture functions from spectrum and render scenes.

from mitsuba2.

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.