Giter Site home page Giter Site logo

atrc's Introduction

Atrc

Offline rendering lab based on ray tracing

Note. GPU version is in development...

Features

  • Volumetric path tracing with next event estimation
  • Volumetric particle tracing
  • Volumetric bidirectional path tracing
  • Stochastic progressive photon mapping
  • Primary sample space MLT on path tracing
  • ReSTIR renderer
  • Various material models: Disney principled BSDF, phong, DreamWorks fabric ...
  • Homogeneous/heterogeneous participating medium
  • Normalized diffusion BSSRDF
  • Almost all material properties can be specified with 2D/3D textures
  • Various geometry models: sphere, quad, triangle, disk, mesh
  • Two-level accelerating structure (SAH based BVH)
  • Importance sampled environment light
  • G-buffer output (albedo, normal, ...)
  • Depth of field
  • ACES tone mapping
  • Image sample space low-pass filter
  • (Optional) Integrated OIDN library
  • (Optional) Integrated Embree library
  • Interactive scene editor

Known Issues

  • Relation between inv gamma correction & linear sampler of image texture

Documentation

doc

Gallery

Editor:

pic

Food (rendered with bdpt) (scene ref here):

0

Juice (rendered with vol_bdpt) (scene ref here):

pic

Classroom (rendered with vol_bdpt) (scene ref here):

pic

Materials: (rendered with pt):

pic

Fog (rendered with vol_bdpt):

pic

BSSRDF (rendered with pt):

pic

Bedroom (rendered with pt) (scene ref here):

1

Dining Room (rendered with bdpt) (scene ref here):

2

atrc's People

Contributors

adven00 avatar airguanz 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

atrc's Issues

How to change Camera manually?

I goto Camera panel. Goto Edit Camera. It has floated values but how to change it? It can not support dot ( ● ) value like 0.1 or ( , ) value like 0,1 (when i change from 0.1 to 0,1 it gone black camera.

How to re-render the scene?

I changed samples per pixel to 4 for fast testing. It was rendered. I close the renderer panel with X button on the right up side. But if i changed spp to 100 and re-rendered again it shows that finished pre-render and then go through 0% of the tendering.

关于pt直接光的多重重要性采样问题

pace_tracing.cpp里面对直接光的采样 会对所有光源先采样再对bsdf采样

            //采样光源
            for(auto light : scene.lights())
            {
                direct_illum += coef * mis_sample_light(
                    scene, light, ent_inct, ent_shd, sampler);
            }
            //采样bsdf
            direct_illum += coef * mis_sample_bsdf(
                scene, ent_inct, ent_shd, sampler);

有两个问题想请教一下:
1.对所有光源采样结果是收敛更快,但是如果场景的diffuse light特别多的话,好像特别费时间,特别是那种用三角网格代表的球形area light,每一个单独的三角形都是一个光源,会不会造成时间消耗加大很多?
2.为什么要把对光源的采样和bsdf的采样分开呢?我在PBRT里看到的做法是:对一个光源采样时包括了对光源和bsdf的采样。类似于代码如下,我是不是没理解明白什么...

            for(auto light : scene.lights())
            {
                //采样光源
                direct_illum += coef * mis_sample_light(
                    scene, light, ent_inct, ent_shd, sampler);
                //采样bsdf
                direct_illum += coef * mis_sample_bsdf(
                        scene, ent_inct, ent_shd, sampler);
            }

还有个对我来说比较费解的问题,为什么使用path tracing会出现离diffuse light很近的地方太亮,有种过曝光的感觉,离光源很远的地方不够亮,是这种渲染方法的限制嘛?
我看大佬的ibl里面好像不需要做对采样时传进来的方向做转换,但是environment light的坐标系和相机的坐标系是不一样的来着,前者是局部坐标系以z轴为上,而后者以y轴为上,莫非其他地方处理过了orz...
感谢大佬的解答!

Request: Exporter for Blender 2.8x

As I see that scene file configs are based on JSON file and all atributes ATRC file? Can we make ATRC exporter for Blender 2.8x? Is it possible? As I'm Blender user it will great if it will make

How to rotate HDR on Z axis?

Hi. I add + button and select to add Rotate option. But when i change on value for example 90° for degree it is appeared not on z but on strange axis position.

Is it possible to use UV from imported OBJ file?

I UV mapped and textured inside Blender one scene and exported it to OBJ file. After that i imported inside AtrC and apply texture to the objects BUT in rendering it cant applied UVs as in Blender. So how to use UVs from extracted OBJ file?

关于三角形SurfacePoint的user和geometry coord的计算问题

  const FVec3 user_z = prim_info.n_a_ + rcd.uv.x * FVec3(prim_info.n_b_a_)
                                     + rcd.uv.y * FVec3(prim_info.n_c_a_);
  inct->user_coord = inct->geometry_coord.rotate_to_new_z(user_z);

triangle_bvh.cpp里的这两行计算shading的局部坐标系时 计算dndu和dndv时 为什么不采用和计算dpdu和dpdv一样的公式
而是直接旋转三角形的面法向量得到呢?另外我有点疑惑将一个坐标系的z轴旋转到新的z轴后 原来的x和y轴的变换是有公式的嘛还是任意计算的呢?我原来以为旋转轴是固定的 是绕着new_z和old_z叉乘得到的那个轴旋转 但是我看大佬代码好像不是这样 不是很理解...
希望大佬能解释一下 感谢不尽T..T

inline _simd_coord_float3_t::self_t _simd_coord_float3_t::rotate_to_new_z(
    const axis_t &new_z) const noexcept
{
    axis_t new_x = cross(y, new_z);
    axis_t new_y = cross(new_z, new_x);
    return self_t(new_x, new_y, new_z);
}

Disney材质transmission的pdf计算问题

想请教一下Disney材质里关于transmission的pdf计算好像和PBRT里不太一样,也和我的理解不太一样...

 real pdf_transmission(const FVec3 &lwi, const FVec3 &lwo) const noexcept
        {
            assert(lwi.z * lwo.z < 0);

            const real eta = lwo.z > 0 ? IOR_ : 1 / IOR_;
            FVec3 lwh = (lwo + eta * lwi).normalize();
            if(lwh.z < 0)
                lwh = -lwh;

            if(((lwo.z > 0) != (dot(lwh, lwo) > 0)) ||
               ((lwi.z > 0) != (dot(lwh, lwi) > 0)))
                return 0;

            const real sdem = dot(lwo, lwh) + eta * dot(lwi, lwh);
            const real dwh_to_dwi = eta * eta * dot(lwi, lwh) / (sdem * sdem);

            const real phi_h       = local_angle::phi(lwh);
            const real sin_phi_h   = std::sin(phi_h);
            const real cos_phi_h   = std::cos(phi_h);
            const real cos_theta_h = local_angle::cos_theta(lwh);
            const real sin_theta_h = local_angle::cos_2_sin(cos_theta_h);

            const real D = microfacet::anisotropic_gtr2(
                sin_phi_h, cos_phi_h,
                sin_theta_h, cos_theta_h, trans_ax_, trans_ay_);
            return std::abs(dot(lwi, lwh) * D * dwh_to_dwi);
}

这里最后返回值

         return std::abs(dot(lwi, lwh) * D * dwh_to_dwi);

为什么不是这样子呢?😕

        return std::abs(cos_theta_h) * D * dwh_to_dwi);

invisible_surface的用途

请问invisible_surface这种材料是用来配合heterogeneous medium来使用的吗?相当于理论上完全透明的表面,只是用来光线求交的。
但是为什么 f 不是直接为 1呢?😵

        BSDFSampleResult sample(const FVec3 &wo, TransMode mode, const Sample3 &sam) const override
        {
            const real cosv = std::abs(cos(geometry_normal_, wo));
            const FSpectrum f = FSpectrum(1) / (cosv < EPS() ? 1 : cosv);
            return BSDFSampleResult(-wo, f, 1, true);
        }

Failed to build

$ cmake ..
-- Building for: Ninja
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build spdlog: 1.4.3
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Build type: Release
CMake Error at CMakeLists.txt:60 (ADD_SUBDIRECTORY):
  The source directory

    C:/msys64/home/Administrator/Atrc/lib/utility

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:62 (TARGET_COMPILE_DEFINITIONS):
  Cannot specify compile definitions for target "AGZUtils" which is not built
  by this project.


CMake Error at CMakeLists.txt:63 (SET_TARGET_PROPERTIES):
  SET_TARGET_PROPERTIES Can not find target to add properties to: AGZUtils


-- Configuring incomplete, errors occurred!

按照文档编译项目出现错误,可以帮忙看一下吗?报错信息如下

Determining if the include file pthread.h exists failed with the following output:
Change Dir: E:/Atrc/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe" "cmTC_ff113.vcxproj" "/p:Configuration=Debug" "/p:Platform=x64" "/p:VisualStudioVersion=15.0"
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2019-09-23 16:34:22.

Project "E:\Atrc\build\CMakeFiles\CMakeTmp\cmTC_ff113.vcxproj" on node 1 (default targets).

PrepareForBuild:

Creating directory "cmTC_ff113.dir\Debug".

Creating directory "E:\Atrc\build\CMakeFiles\CMakeTmp\Debug".

Creating directory "cmTC_ff113.dir\Debug\cmTC_ff113.tlog".

InitializeBuildStatus:

Creating "cmTC_ff113.dir\Debug\cmTC_ff113.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

ClCompile:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_ff113.dir\Debug\" /Fd"cmTC_ff113.dir\Debug\vc141.pdb" /Gd /TC /errorReport:queue E:\Atrc\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl /c /Zi /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_ff113.dir\Debug\" /Fd"cmTC_ff113.dir\Debug\vc141.pdb" /Gd /TC /errorReport:queue E:\Atrc\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c
CheckIncludeFile.c

E:\Atrc\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [E:\Atrc\build\CMakeFiles\CMakeTmp\cmTC_ff113.vcxproj]
Done Building Project "E:\Atrc\build\CMakeFiles\CMakeTmp\cmTC_ff113.vcxproj" (default targets) -- FAILED.

Build FAILED.

"E:\Atrc\build\CMakeFiles\CMakeTmp\cmTC_ff113.vcxproj" (default target) (1) ->

(ClCompile target) ->

E:\Atrc\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [E:\Atrc\build\CMakeFiles\CMakeTmp\cmTC_ff113.vcxproj]

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.47

GLFW和GLEW配置

在readme中没看到GLFW和GLEW在windows上的相关配置。需要将这两个配置在哪个目录下,麻烦请详细说明。

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.