Comments (3)
Yeah, that would be great to have support for.
Do you have a example of what you write them out as now?
Pbrt has the DiffuseAreaLight, is it that you are writing it as?
Or are you creating a mesh plane and then applying a blackbody material to it?
DiffuseAreaLight::DiffuseAreaLight(const Transform &LightToWorld,
const MediumInterface &mediumInterface,
const Spectrum &Lemit, int nSamples,
const std::shared_ptr<Shape> &shape,
bool twoSided)
I do not think we can 'hide' the light source, but there is a bool for twosided, which means we can look 'through' the light source from behind (and it will only cast light 'forwards').
We also need to get all those custom parameters for PBRT in there, same with point\spot and so on, but that's another task on the todo list.
from io_scene_pbrt.
Currently, I create a mesh an attach it with a "diffuse" light source.
One example of output (inside PBRT file):
AttributeBegin
Transform [-0.142275 -0.567970 0.810659 0.000000 -0.275366 0.809372 0.518740 0.000000 -0.950753 -0.149424 -0.271553 0.000000 -3.382452 -0.479583 0.946010 1.000000 ]
Scale 7.0 1.0 1.0
Scale 0.5 0.5 -1.0
AreaLightSource "diffuse" "rgb L" [ 4.784638285636902 10.0 0.14450596645474434 ]
Shape "trianglemesh"
"point P" [ -1.0 -1.0 0.0 1.0 -1.0 0.0 1.0 1.0 0.0 -1.0 1.0 0.0 ]
"normal N" [ 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0 ]
"float UV" [ 0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0 ]
"integer indices" [ 0 1 2 2 3 0]
AttributeEnd
The python code responsible to generate this output:
if la.type == "AREA" :
pbrt_file.attr_begin()
# Transform
pbrt_file.write( "Transform [" + matrixtostr( ob.matrix_world.transposed() ) + "]\n" )
pbrt_file.write( f"Scale {la.size} {la.size_y} 1.0 \n" )
pbrt_file.write( f"Scale 0.5 0.5 -1.0 \n" )
pbrt_file.write("\n")
pbrt_file.write( f'Material "none"\n' )
# Radiance
pbrt_file.write(f'AreaLightSource "diffuse" "rgb L" [ {light_color[0]} {light_color[1]} {light_color[2]} ]\n')
pbrt_file.write("\n")
# Shape
pbrt_file.write(r'Shape "trianglemesh"')
pbrt_file.write("\n")
pbrt_file.write(r'"point P" [ -1.0 -1.0 0.0 1.0 -1.0 0.0 1.0 1.0 0.0 -1.0 1.0 0.0 ]')
pbrt_file.write("\n")
pbrt_file.write(r'"normal N" [ 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 1.0 ]')
pbrt_file.write("\n")
pbrt_file.write(r'"float uv" [ 0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0 ]')
pbrt_file.write("\n")
pbrt_file.write(r'"integer indices" [ 0 1 2 2 3 0]')
pbrt_file.write("\n")
pbrt_file.attr_end()
I do not think we can 'hide' the light source
Well, I am not sure. The only idea I can think of is using the "none" material. This material act as a passthrough for the volumetric path tracer (as mesh are used to define participating media boundaries). However, this material might only be compatible with this specific integrator (I am not super familiar with PBRT-v3; I have to check this later).
from io_scene_pbrt.
I have not tried the 'none' material, so I do not know if it's only supported by specific integrators.
If the 'none' material is not supported well - then it would be nice to use the 'area light' directly - if the 'none' material is not supported by other integrators, that way area lights will be supported the same way as in pbrt.
from io_scene_pbrt.
Related Issues (20)
- multiple materials on the same mesh HOT 7
- Add support for mediums HOT 1
- How to export? HOT 5
- Output path issue HOT 1
- Fix mesh export bug HOT 3
- Texture export in disney material is missing. HOT 1
- Skip material export of objects with no material assigned. HOT 1
- AttributeError: 'Scene' object has no attribute 'update' HOT 3
- Fix so that export_texture_from_input(...) returns 'none' if no texture is assigned. HOT 1
- Some times materials has to be removed fully, then re-apply to make it export HOT 2
- convert blender's shaders over to pbrt shaders on export. HOT 2
- Fix so that render panel only shows up when PBRT render engine is selected HOT 1
- field of view HOT 3
- issue with subsurface modifier HOT 3
- Update so that it exports to native Pbrt-v4 format HOT 2
- Fix so that custom nodes shows texture in viewport. HOT 1
- Add support for hair.
- Is projection light source supported? HOT 1
- Fix so that shader nodes shows up in latest blender for pbrt-v4-support branch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from io_scene_pbrt.