Coder Social home page Coder Social logo

luxcorerender / blendluxcore Goto Github PK

View Code? Open in Web Editor NEW
693.0 46.0 87.0 19.65 MB

Blender Integration for LuxCore

License: GNU General Public License v3.0

Python 99.68% Shell 0.32%
blender blender-addon 3d-graphics raytracer ray-tracing opencl gpu-computing luxcorerender visualization

blendluxcore's Introduction

LuxCoreRender.org | Forums | Wiki

BlendLuxCore

This addon integrates the LuxCore render engine into Blender. It offers advanced features like accelerated rendering of indirect light and efficient rendering of caustics.

Supported Blender Versions

  • Blender 3.6 LTS is experimentally supported by the latest branch development release.
  • Blender 2.93 is supported by BlendLuxCore v2.6.
  • Blender 2.83-2.92 are supported by BlendLuxCore v2.5.
  • Blender 2.83 is supported by BlendLuxCore v2.4.
  • Blender 2.80, 2.81 and 2.82 are supported by BlendLuxCore v2.2 and v2.3.
  • Blender 2.79 is supported by BlendLuxCore v2.0, v2.1 and v2.2.

Download

See the release section for stable and experimental versions.
Information about installation and usage are available in the manual.

Examples

To see what can be achieved with LuxCore, check our gallery.
You can also download complete example scenes.

Example Render

blendluxcore's People

Contributors

acasta69 avatar alpistinho avatar beheadedkamikaze avatar codefhd avatar cruderustle avatar dade916 avatar debihood avatar feynmanliang avatar michelchafouin avatar neo2068 avatar odil24 avatar philstix avatar rebpdx avatar theverat avatar thot-experiment avatar u3dreal avatar zareami10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blendluxcore's Issues

Support hair

Todo:

  • Implement hair export

  • Test and verify

  • Prevent "singular matrix in matrixinvert" error (can happen with kempt hair, probably when a hair strand is compressed into a single point) - maybe add a small epsilon to all hair coordinates?

  • Accelerate with LuxCore C++ function?
    Seems like accelerating this with C++ is a lot of work, because we need the co_hair() method of the particle system class.
    We would either have to link against blender (haha) or re-implement this function in our code.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Sometimes viewport render continues to run

Sometimes viewport render continues to run after it was cancelled in Blender (by setting viewport shading to something else than "RENDERED").
The same old problem... even though I followed the Cycles implementation this time.

Make sure the min epsilon has a good default value

A wrong min epsilon value can often lead to artifacts (e.g. z-fighting).
Make sure the default value works well in almost all situations.
If this is not possible, provide several easy-to-use presets with descriptions, or auto-scale it with scene size.

Make OpenGL viewport modes work as expected

  • Materials should use the primary color of the node material (e.g. diffuse color of matte node)
  • User should be able to set the texture that is currently shown in viewport
  • Light strength should probably correlate to brightness somehow (e.g. efficacy * power * gain)

Also investigate if we can make the "material" viewport mode work correctly.

Memory Leak

  • Start Blender
  • Start and stop a lot of sessions
  • RAM usage goes up and never frees until Blender is closed

scrn_2017-12-03_19-37-08

Support particles

Todo:

  • Particle export
  • Dupliverts/faces/frames export
  • Accelerate with LuxCore C++ function
  • Correct visibility (hide/show emitter and layers)

Color Management

I managed to implement Color Management support for the viewport, so viewport and final render now both have Blender Col. Management applied to them.
However, the final render was still too bright, so I currently make it darker in LuxCore imagepipeline.
I'm also not sure if Blender expects a tonemapped LDR image, a tonemapped HDR or a untonemapped HDR from the render engine, I could not find anyhting about this in the Blender docs.

Create Automated Tests

The basic structure is there, but we need more tests.

  • Materials
  • Motion blur
  • Lights
  • World
  • Textures
  • Objects
  • Linked objects
  • Particles
  • Duplis
  • Hair
  • Worldscale different from 1.0
  • and more...

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

film resize crashes Blender/LuxCore

The call to Exporter._update_config(self, session, config_props) crashes Blender with a SIGSEV.
Sometimes it hangs first.

Not sure if I'm using Blender or LuxCore wrong or if there's a deeper bug hidden here.

    def _update_config(self, session, config_props):
        # TODO: hangs/crashes blender...
        renderconfig = session.GetRenderConfig()
        session.Stop()
        renderconfig.Parse(config_props)
        if renderconfig is None:
            print("ERROR: not a valid luxcore config")
            return
        
        session = pyluxcore.RenderSession(renderconfig)
        session.Start()

Write the wiki pages

BlendLuxCore wiki pages are collected in a category: http://wiki.luxcorerender.org/Category:BlendLuxCore
The pages should have this code at the end to be put in the category:

[[Category:BlendLuxCore]]
  • When you need to describe a basic Blender feature, e.g. how to add a material, try to link to the Blender Manual before describing it yourself.
  • When you need to describe a basic LuxCore feature, e.g. the shadow catcher, link to the page in the LuxCore Manual and only describe the specifics of the use in Blender on the BlendLuxCore page.

Todo:


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Make sure everything has a description

Every property that is not absolutely, mind-boggingly obvious should have a description.
And the description must not be equal to the name of the property!
Also, please try to put yourself into the mind of a new user a bit. Stuff like "Absorption Depth (nm)" or "Sigma" might be obvious to a long-term Lux user, but not to newcomers.

I'm also considering putting links to the wiki in the more complex places, e.g. the carpaint material is basically impossible to tune if you don't have the wiki article open on the side.
Example: 0b043e2


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Support light groups

  • Lighgroups are exposed in the UI
  • Lightgroups are registered as Blender passes
  • Lightgroups are tonemapped
  • Settings (color/temperature) are exported
  • Live updates during viewport render
  • Live updates during final render

Error with mix material export if volumes are used

System Information

windows 10, NVIDIA GTX 1080 + GTX 780

Software Version

Blender version: 2.79
LuxCore version: 2.0 alpha, 09e8e78

Error message from Blender console

ERROR: Reference to an undefined NamedObject name: Glass__Material_nodeMat_Mat_Nodes__002_mat
Traceback (most recent call last):
  File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\engine\__init__.py", line 142, in view_update_lux
    self._session = self._exporter.create_session(self, context.scene, context)
  File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\export\__init__.py", line 203, in create_session
    luxcore_scene.Parse(scene_props)
RuntimeError: Reference to an undefined NamedObject name: Glass__Material_nodeMat_Mat_Nodes__002_mat

Short description of error

If a mix material is used in combination with volumes the mix material definition happens before the input materials. That results in an error.

Exact steps for others to reproduce the error

use mix material with volumes, e.g. the following material node tree
grafik

converting object: Cube.022
converting mesh: Cube.025
nodeMatSURFACE
scene.volumes.Volume__Node__Tree__004SHADER.emission = 0 0 0
scene.volumes.Volume__Node__Tree__004SHADER.ior = 1.4950000047683716
scene.volumes.Volume__Node__Tree__004SHADER.type = "clear"
scene.volumes.Volume__Node__Tree__004SHADER.absorption = 3.7987448098447238 0.87892013825335269 3.4369541083131394
scene.materials.nodeMatSURFACE.volume.interior = "Volume__Node__Tree__004SHADER"
scene.materials.Glass__Material_nodeMat_Mat_Nodes__002_mat.kt = 1 1 1
scene.materials.Glass__Material_nodeMat_Mat_Nodes__002_mat.type = "glass"
scene.materials.Glass__Material_nodeMat_Mat_Nodes__002_mat.kr = 1 1 1
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.kd = 0.69999998807907104 0.69999998807907104 0.69999998807907104
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.vroughness = 0.05000000074505806
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.ks = 0.05000000074505806 0.05000000074505806 0.05000000074505806
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.type = "glossy2"
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.d = 0
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.ka = 0 0 0
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.uroughness = 0.05000000074505806
scene.materials.Glossy__Material_nodeMat_Mat_Nodes__002_mat.multibounce = 0
scene.materials.nodeMatSURFACE.amount = 0.5
scene.materials.nodeMatSURFACE.material1 = "Glass__Material_nodeMat_Mat_Nodes__002_mat"
scene.materials.nodeMatSURFACE.type = "mix"
scene.materials.nodeMatSURFACE.material2 = "Glossy__Material_nodeMat_Mat_Nodes__002_mat"

Don't apply color management settings when unpacking images

See my previous attempt at fixing this issue:
3e030af (reverted)
Unfortunately this crashes Blender, probably because we're manipulating bpy.data in the wrong context or something.
Have to find another way to save a packed image without applying the exposure etc. from the color management settings of the current scene.

Support motion blur

  • object blur
  • camera blur
  • motion blur for area lights
  • test if steps > 2 works as expected
  • handle accelerator behaviour (some, like Embree, don't support steps > 2) Embree supports it now.
  • fix bug in object motion blur: object seems to travel further than it's start and end points.

Related: LuxCoreRender/LuxCore#44

Viewport border rendering in camera view is broken

The offset and size of the border render is not correct when panning around (right after the start of the rendering the offset is correct, but I think the size is not).
After starting the render:

scrn_2017-12-04_17-31-00
After panning in the view to the side:

scrn_2017-12-04_17-31-13

wrong export of area lights in final render

System Information

windows 10, NVIDIA GTX 1080 + GTX 780

Software Version

Blender version: 2.79, 850f736,
LuxCore version: 2.0 alpha1, 9b3ae91

Short description of error
The plane of an area light is not exported correctly in final render mode. In viewport rendering everything is fine.

Exact steps for others to reproduce the error
Add an area light visible in the camera view and hit F12.
Viewport render:
arealight1

Final render:
grafik

Allow deleting of objects/lights during viewport render

I mean, you can delete objects. But currently they are not deleted in the LuxCore session.

Here's how I did it in LuxBlend: https://bitbucket.org/luxrender/luxblend25/src/10dd12c045d79530acf763642af28e1180903e11/src/luxrender/core/__init__.py?at=default&fileviewer=file-view-default#__init__.py-2455

                if update_changes.cause_objectsRemoved:
                    for ob in update_changes.removed_objects:
                        key = get_elem_key(ob)

                        if ob.type == 'LAMP':
                            if key in self.luxcore_exporter.light_cache:
                                # In case of sunsky there might be multiple light sources, loop through them
                                for exported_light in self.luxcore_exporter.light_cache[key].exported_lights:
                                    luxcore_name = exported_light.luxcore_name

                                    if exported_light.type == 'AREA':
                                        # Area lights are meshlights and treated like objects with glowing materials
                                        luxcore_scene.DeleteObject(luxcore_name)
                                    else:
                                        luxcore_scene.DeleteLight(luxcore_name)
                        else:
                            if key in self.luxcore_exporter.object_cache:
                                # loop through object components (split by materials)
                                for exported_object in self.luxcore_exporter.object_cache[key].exported_objects:
                                    luxcore_name = exported_object.luxcore_object_name
                                    luxcore_scene.DeleteObject(luxcore_name)

Complete texture support

To do:

  • blender_noise
  • normalmap
  • uv
  • wood (seems like blender_wood to me, was not exposed in LuxBlend)
  • checkerboard2d

Done:

  • band

  • blender_blend

  • blender_clouds

  • blender_distortednoise

  • blender_magic

  • blender_marble

  • blender_musgrave

  • blender_stucci

  • blender_wood

  • blender_voronoi

  • brick

  • checkerboard3d

  • constfloat1

  • constfloat3

  • dots

  • fbm

  • hitpointalpha We won't expose this, Blender vertex colors have no alpha anyway. We only use it implicitly in the pointiness node.

  • hitpointcolor

  • hitpointgrey

  • hsv

  • imagemap

  • marble

  • windy

  • wrinkled

  • blackbody

  • irregulardata

  • lampspectrum

  • Fresnel Textures

    • fresnelcolor
    • fresnelpreset
    • fresnelsopra
    • fresnelluxpop
  • Colormix (color in/outputs):

    • add
    • subtract
    • mix
    • scale
    • abs
    • clamp
  • Math (float in/outputs):

    • add
    • subtract
    • mix
    • scale
    • abs
    • clamp

Material not updated if name changed during viewport render

Open viewport render preview change your material name (eg "Or" to "gold") then play with node settings it wann't update in the viewport preview

We are using the material.name property as a key.
Maybe we can use something else that does not change when the material is renamed.
Maybe the memory address? It changes only on undo/redo, but in this case the whole viewport render is deleted and re-started anyway.

Support AOVs

See my question and answer here: https://blender.stackexchange.com/questions/100791/how-to-use-the-new-render-pass-api-for-an-external-renderer

Todo

  • Implement basic AOVs that don't need an ID
  • Investigate what's going on with the CONVERGENCE Output (always -inf or something)
  • Investigate if we can make AOV import faster. Currently the times are like this:
Importing DEPTH took 0.368s
Importing UV took 0.647s
Importing ALPHA took 0.391s
  • Investigate what's going on with the IRRADIANCE output
  • light groups

BY_MATERIAL_ID etc. are not part of this issue, for those see #230

Auto Smooth setting not recognized

System Information

Ryzen 1800x, RX480 8GB

Software Version

  • Blender version: 2.79
  • LuxCore version: 2.0 Alpha 1

Short description of error

My polygon with hard edges are now smooth and round. Should have hard define edges.

Exact steps for others to reproduce the error

Use Suzanne and messing with Auto Smooth and degree threshold. Doesn't seem to do anything.

Allow Blender text files as IES files

This would make IES file usage more portable (e.g. you could pack them in the .blend if you want to distribute it later - good for example scenes).
Maybe we would need to add support for inlined text to the IES socket of LuxCore lights for this to work. Or we always save the text to a temp file on export.

Rename UI classes to follow Blender's naming conventions

See https://wiki.blender.org/index.php/Dev:2.8/Source/Python/UpdatingScripts (section "Naming").
Currently we get a bunch of warnings in our travis tests because of this:

========================================
full_export.test
========================================
found bundled python: /home/travis/build/LuxCoreRender/BlendLuxCore/tmp/blender/2.79/python
libdc1394 error: Failed to initialize libdc1394
Warning: 'LuxCoreLens' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDepthOfField' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreMotionBlur' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreConfig' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDeviceSettings' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreDisplaySettings' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreErrorLog' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreHaltConditions' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampPerformance' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreLampVisibility' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreMaterialHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCorePostProcessing' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldHeader' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldSky2' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldInfinite' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldPerformance' doesn't contain '_PT_' with prefix & suffix
Warning: 'LuxCoreWorldVisibility' doesn't contain '_PT_' with prefix & suffix
pyluxcore version: 2.0alpha1
Read blend: /home/travis/build/LuxCoreRender/BlendLuxCore/tests/./full_export/full_export.test.blend
...

I think it only concerns UI classes.

Todo:

  • Warning: 'LuxCoreLens' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreDepthOfField' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreMotionBlur' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreConfig' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreDeviceSettings' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreDisplaySettings' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreErrorLog' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreHaltConditions' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreLampHeader' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreLampPerformance' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreLampVisibility' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreMaterialHeader' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCorePostProcessing' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreWorldHeader' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreWorldSky2' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreWorldInfinite' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreWorldPerformance' doesn't contain '_PT_' with prefix & suffix
  • Warning: 'LuxCoreWorldVisibility' doesn't contain '_PT_' with prefix & suffix

Use LuxCore's halt conditions

Also overhaul noise halt conditions UI (tiles) and add support for batch.haltthreshold etc.
https://wiki.luxcorerender.org/LuxCore_SDL_Reference_Manual_v2.0#Rendering_halt_conditions

Todo:

  • Expose noise threshold
  • Expose SOBOL sampler's adaptive render settings (convergence test warmup, step etc.)
  • Make it possible to update the halt conditions during final render (and update the wiki once this is implemented)
    How to implement: LuxCoreRender/LuxCore@c7b555f
  • Unify tiled render noise properties with the ones from adaptive sampling

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Support Blender color management in viewport render

It seems to be possible.
See:

Problem: Can't create a NULL offset needed for glVertexAttribPointer and glDrawElements... https://lists.blender.org/pipermail/bf-committers/2016-March/046880.html
Possible workaround: use PyOpenGL: https://blenderartists.org/forum/showthread.php?401171-Vertex-Buffer-Object-with-bgl

What I want to replicate: Device::draw_pixels function in cycles/device/device.cpp
maybe it works without NULL pointers? too tired right now.

Use Blender temp dir

We could create temporary files in bpy.app.tempdir instead of the python default directory.
E.g. in the image exporter (export/image.py).
Not very important, I think it could be useful for users who want tempfiles to be created on some special disk/partition.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Complete Light Export

Todo:

  • Implement light export for all types
  • Support diffuse/glossy/specular indirect visibility for certain light types

ReferenceError: StructRNA of type LuxCoreRenderEngine has been removed

Sometimes when quitting Blender, I get this message:

LuxCoreRenderEngine del
Exception ignored in: <bound method LuxCoreRenderEngine.__del__ of <bpy_struct, LuxCoreRenderEngine invalid>>
Traceback (most recent call last):
  File "/home/simon/.config/blender/2.79/scripts/addons/BlendLuxCore/engine/__init__.py", line 25, in __del__
    if hasattr(self, "_session") and self._session:
ReferenceError: StructRNA of type LuxCoreRenderEngine has been removed

edit: seems to be related to exception handling, it happens sometimes when exceptions were handled in the engine's render method.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Resizing Lamp/sun triggers an update

System Information

W10 / HD7970 /i7 6700k

Software Version

  • Blender version: 2.79
  • LuxCore version: 2.0 alpha 1

Error message from Blender console

Short description of error

*Nothing special the viewport preview just get an useless update

Exact steps for others to reproduce the error

Just resize your sun or lamp (area lamp not considered) in while render preview is working

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.