tzuchieh / photon-v2 Goto Github PK
View Code? Open in Web Editor NEWA program that takes photographs of a virtual world.
Home Page: https://tzuchieh.github.io/photon_v2_what_is_photon.html
License: MIT License
A program that takes photographs of a virtual world.
Home Page: https://tzuchieh.github.io/photon_v2_what_is_photon.html
License: MIT License
Currently, integer type in SDL is implemented using int32; this can potentially lead to bugs caused by integer overflow.
Mostly because there is no surface for photons to land on. Photon tracer will keep shooting photons and cannot reach a certain number of recorded photons.
This problem can also appear when appending materials/nodetrees from other blend files.
safe_xxx() methods/functions can provide a default value if the requested operation cannot be done, e.g., when normalizing a zero vector, use the default vector specified by the user instead
Currently unit test do not cover higher level functionality test. Need to have them (such as BSDF varification).
This can better self-document the intention of a parameter instead of just a raw string.
TODOs:
A file format for a series of commands, this will allow users to easily share their data, e.g., materials, geometries...
This feature should be done as soon as possible, since every change in the SDL syntax can potentially break a bunch of existing scene files.
Rendering spherical area light with tiny radius (~0.005) starts to show signs of numeric error. Specifically, render the following scene with triangles then with a sphere produces different results:
## camera(pinhole) [real fov-degree 30] [vector3r position "0 6 40"] [vector3r direction "0 0 -1"]
## film(hdr-rgb) [integer width 800] [integer height 800] [string filter-name "gaussian"]
## sample-generator(stratified) [integer sample-amount 10000][integer num-strata-2d-x 800][integer num-strata-2d-y 800]
## integrator(bneept)
//## integrator(surface-normal)
-> geometry(rectangle) @plane [real width 15] [real height 15]
-> geometry(rectangle) @smallPlane [real width 0.5] [real height 0.5]
-> geometry(sphere) @smallBall [real radius 0.005]
//-> geometry(sphere) @target [real radius 3]
-> geometry(rectangle) @target [real width 4] [real height 4]
-> material(matte-opaque) @white [vector3r albedo "0.8 0.8 0.8"]
//-> material(abraded-opaque) @white [vector3r albedo "0.8 0.8 0.8"] [real roughness-v 0.02] [real roughness-u 0.1] [vector3r f0 "0.9 0.9 0.9"]
-> actor(model) @ground [geometry geometry @plane] [material material @white]
-> actor(model) rotate(@ground) [vector3r axis "1 0 0"] [real degree -90]
-> actor(model) scale(@ground) [vector3r factor "10 10 10"]
-> actor(model) @object [geometry geometry @target] [material material @white]
-> actor(model) translate(@object) [vector3r factor "0 4 0"]
-> actor(model) rotate(@object) [vector3r axis "1 0 0"] [real degree -90]
-> light-source(area) @areaSource [vector3r emitted-radiance "400000 400000 400000"]
-> actor(light) @topLight [geometry geometry @smallBall] [material material @white] [light-source light-source @areaSource]
-> actor(light) translate(@topLight) [vector3r factor "0 10 0"]
-> actor(light) rotate(@topLight) [vector3r axis "1 0 0"] [real degree 90]
-> actor(light) rotate(@topLight) [vector3r axis "0 0 1"] [real degree 45]
Currently, I believe the problem lies in ray-sphere intersection test.
Currently, emitters are single-sided. If a ray hits some back-facing emitters, its intersection point may be slightly in front of the emitter. Consequently, if the emitter's material is double-sided and picks a sample direction on the same hemisphere with V, we will intersect ourself and this time causing light leaks. The amount of leaking light is tiny but visible. This scene demonstrate the issue:
## camera(pinhole) [real fov-degree 30] [vector3r position "0 0 0"] [vector3r direction "0 0 -1"]
## sample-generator(stratified) [integer sample-amount 18] [integer num-strata-2d-x 256] [integer num-strata-2d-y 256]
## renderer(sampling) [integer width 1280] [integer height 720] [string filter-name gaussian] [string estimator bvpt]
-> light-source(sphere) @source1 [real radius 1] [real watts 200] [vector3r linear-srgb "1 1 1"]
-> light-source(rectangle) @source2 [real width 2] [real height 2] [real watts 200] [vector3r linear-srgb "1 1 1"]
-> actor(light) @light1 [light-source light-source @source2]
-> actor(light) translate(@light1) [vector3r factor "0 0.5 -6"]
-> actor(light) rotate(@light1) [vector3r axis "1 0 0"][real degree 180]
Seems like worker threads get blocked quite often when progress is being reported too frequently.
Purposes:
TODOs:
Split normal and its related features are not respected by the depsgraph passed to the RenderEngine. This can be a Blender bug. Exporting scene files from the menu and render in PhotonStudio does not have this issue since split normal effects are faked using modifiers.
IIRC using PhotonBlend to export scene files with height > width will produce the problem. After rendering, the image looks like having incorrect camera parameters (something like strange FOV).
Several notes:
Need to do the following:
possible solution is adding check in Actors (by checking Intersectable::hasTransformation())
Some parts of the codebase are messed up to quickly support some features:
these should be cleaned up or refactored
Error parsing image filename with spaces. Issue discovered when parsing simple Lambertian diffuse with textured albedo.
Currently a mis-press is very likely to crash the program.
This should be done with #32 integrated
The implementation should allow
Perhaps the compression level is too high.
Makes the type of film used by some renderers changeable (by users).
It would be beneficial to have a helper class/method to load binary files into a vector of chars or bytes.
Currently the implementation parses SDL strings as raw bytes, which means we treat them as ASCII codes. This can lead to serious error if some SDL strings contain UTF-8 characters.
The website: https://rgl.epfl.ch/materials
The stack trace message should incorporate with Photon's assertion macros, and should be cross-platform (or at least on MSVC and g++).
Generally, optimize memory-related parts.
Transforms do not occupy memory as much as primitives (unless meshes are created with one-transform-per-primitive basis); we should just pass data around rather than raw pointers.
To be done:
The following scripts need this fix. They occasionally fail.
https://github.com/TzuChieh/Photon-v2/blob/master/scripts/download_resource.py
https://github.com/TzuChieh/Photon-v2/blob/master/scripts/download_thirdparty_library.py
It is unclear for now that who is responsible for the creation of PrimitiveMetadata. Specifically, we need a clear documentation or implementation that clears the following mysteries:
The implementation requires
The structure of Photon's resource system is becoming more and more complex, increasing the risk of smart pointer cyclic reference. Consider using weak_ptr or just raw pointers.
First steps include
After we have interactive renderer
Relevant file:
https://github.com/TzuChieh/Photon-v2/blob/develop/Engine/Source/Math/constant.h
The idea would be somehow store the most precise constant and derive other type-safe constants using constexpr
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.