当前位置: 首页 > news >正文

2020-12-20

==============
BSSRDF
https://gao-duan.github.io/blogs/bssrdf/index.html
https://gao-duan.github.io/blogs/bssrdf/index.html
BSSRDF aims to simulate volume scatterings using simplified assumption.

进入
https://gao-duan.github.io/
点击 Blog 进入
https://gao-duan.github.io/blogs/blog.html
点击 Implementation of BSSRDF model 进入
https://gao-duan.github.io/blogs/bssrdf/index.html

BSSRDF

Duan gao

bssrdf
Bunny rendered by my own renderer Elegans.

BSSRDF aims to simulate volume scatterings using simplified assumption.
Separate BSSRDF

Split the BSSRDF into 3 parts: (Eq 11.7 in PRRT-v3)

About c (normalized factor),

And assume the 

is only related to

:

And the render equation:

Next I will introduce

of normalized diffusion BSSRDF model and how to important sampling this BSSRDF.

Normalized diffusion BSSRDF

The key idea is using Exp function to approximate

(including single-scattering and multiple-scattering).

formula (using mean free path

as parameter )

From equation 3 in [1],

    change 

to , because
in dipole diffusion represents the internal reflection parameter;

    represents effective albedo, which is described in PBRT-v3 eq 11.11)

where
is the distance between and , is scale factor and

is mean free path length.

Another formula (using diffuse mean free path

as parameter)

Compute
and from physically based parameters (, , ,

):

(diffuse mean free path)

(scale factor)

(define

):

[1] Christensen P H. An approximate reflectance profile for efficient subsurface scattering[C]//ACM SIGGRAPH 2015 Talks. ACM, 2015: 25.

https://graphics.pixar.com/library/ApproxBSSRDF/paper.pdf

[2] Jensen H W, Marschner S R, Levoy M, et al. A practical model for subsurface light transport[C]//Proceedings of the 28th annual conference on Computer graphics and interactive techniques. ACM, 2001: 511-518.

https://http://graphics.stanford.edu/papers/bssrdf/bssrdf.pdf

Importance Sampling BSSRDF

There are two main approaches to implement BSSRDF model in physically based renderer.

precompute irradiance in point cloud which sampled uniformly and compute the contribution in rendering.

For example, the implementation in Mitsuba dipole.cpp.

importance sampling the BSSRDF directly in rendering.

More details about importance sampling the BSSRDF can be found in Section 6 of [1] and [2]. 

In the normalized diffusion BSSRDF model implementation, I use the second approach.

  1. Sample BSSRDF and corresponding pdf

It is nontrivial to sample a neighborhood point of
based on profile

.
1.1 Basic disk-based BSSRDF sampling

In the disk based sampling strategy, we map the 1D profile

to 3D point in the surface geometry.

The key idea is :

using 

to define a bounding sphere of , the sampled

will located in some position on this sphere.

1567511127759

sample
from (

[we need to map this radius value to a 3D point].

1567510267483

sample angle
(

) of the disk.

1567510385749

project the point on 2D-disk to 3D sphere.

1567510932190

emit probe ray (from base to target) and find the interaction which serve as the sampled point

.

The contribution is:

1567511538632

1.2 Axis and channels sampling

Using normal vector
as the axis will lead to high variance in some sharp corners. (due to the dot product of and

will be very small (close to zero)) :

1567512217208

The solution is picking z axis from

randomly .

For the channels, each channels may have different

profiles, so we can also randomly pick one channel from R,G,B.

Now the contribution of each sample is (

) :

For the axis and channel sampling, we use MIS to combine them (regarding each axis and channel as one sampling strategy):

Recall the MIS:

and

.

=>

1.3 Sampling scheme (NormalizedDiffusionBSSRDF::Sample)

sample vertical axis randomly 

sample channel randomly [r,g,b]

sample
from to get bounding sphere // [remain] how to sample from

sample
from and angle in disk // [remain] how to sample from

project point in disk into bounding sphere to get base and target

use probe ray (base => target) to find all possible interactions and random pick one (serve as

)

evaluate the BSSRDF

In the implementation,
, ,

are considered separately.

For NormalizedDiffusionBSSRDF::Sample(), we only need to return 

    .

 

For 

, it is already considered in the BRDF (glass material). It is the pdf of transmit and only need to consider BSSRDF in this case.

For
, it is considered in

, which is called in NormalizedDiffusionAdaptor::Eval()

1.4 Pdf of above sampling (NormalizedDiffusionBSSRDF::Pdf_Sample)

For n sample strategies, the estimator is:

So the total pdf is

(the pdf of all strategies).

For each
, (

)

is trivial to evaluate,

will be introduced in next part.

  1. Sample
    and

How to sample
from

profile?

Recall Monte Carlo estimator for 

is

,

And the PDF should satisfies:

Inversion method to sample
from

:

compute CDF:

inverse of CDF:
uniform random number

Recall

:

satisfies: (integration in polar coordinates is always 1)

So the desired PDF is proportional to

.

Assume

,

So the PDF is

And the CDF is:

However, the CDF is not analytically invertible.

There are too methods to solve this problem.

We can use MIS to sample the 2 exp term separately:

    Strategy 1(for first exp term)

    Assume the PDF is 

So the PDF is

CDF is:

:

Strategy 2 (for second exp term)

Assume the PDF is

So the PDF is

CDF is:

:

Precompute the
when

, and multiply d in rendering.

:

python script to precompute the inverse CDF

import scipy

from math import exp

def F(r, xi):

  return 1.0 - 0.25 * exp(-r) - 0.75 * exp(-r/3) - xi

steps = 1024

x0 = 0

R = []

XI= []

for i in range(steps + 1):

  xi = 1.0 / (steps) * r

  r = scipy.optimize.newton(F,x0,args=(xi,))

  x0 = r

  XI.append(xi)

  R.append(r)

print®

Sample
(precompute

)

given random variable

:

locate 

in

array.
Linear interpolate two neighborhood.
multiply d. 

Pdf: just return

. 

[1] Christensen P H. An approximate reflectance profile for efficient subsurface scattering[C]//ACM SIGGRAPH 2015 Talks. ACM, 2015: 25.

https://graphics.pixar.com/library/ApproxBSSRDF/paper.pdf

[2]King A, Kulla C, Conty A, et al. BSSRDF importance sampling[C]//ACM SIGGRAPH 2013 Talks. ACM, 2013: 48.

http://www.aconty.com/pdf/bssrdf.pdf

[3] http://shihchinw.github.io/2015/10/bssrdf-importance-sampling-of-normalized-diffusion.html

Combining BSSRDF in path tracing

1567661953093

direct lighting of BSSRDF compute in 

.

indirect lighting (from

sample the next direction)

In
and , there are BSDF sample happened (contains Fresnel transmit and

).

(there are some discussions about the implementation details in [1])

[1] https://github.com/mmp/pbrt-v3/issues/19

相关文章:

  • URP源码学习(三)渲染管线的默认实现,forward
  • URP 文档
  • XLua 源码学习原理(一)
  • [PyQt] 使用.qrc 生成资源文件供程序中使用
  • [Qt]设置窗口图标和EXE应用程序图标
  • 蓝噪声取样(Blue noise sampling) 相关知识
  • 关于cmd运行自动进行远程连接(自动填写用户及密码)
  • mstsc保存用户名和密码,实现自动登录远程桌面
  • mstsc命令详解
  • Loading.UpdatePreloading是什么东西,为什么会突然那么高?
  • unity中Loding.UpdatePreloading占用CPU过高如何解决?
  • [总结] 漫谈HDR和色彩管理(四)HDR标准和ACES
  • 视频名词浅析——HDR
  • 虚幻引擎学习之路:渲染模块之全局光照明
  • 我所理解的DirectX Ray Tracing
  • hexo+github搭建个人博客
  • 时间复杂度分析经典问题——最大子序列和
  • 【391天】每日项目总结系列128(2018.03.03)
  • CSS实用技巧干货
  • ES6语法详解(一)
  • HTML中设置input等文本框为不可操作
  • Java 11 发布计划来了,已确定 3个 新特性!!
  • JavaScript创建对象的四种方式
  • Meteor的表单提交:Form
  • PHP面试之三:MySQL数据库
  • React-生命周期杂记
  • Spring Cloud中负载均衡器概览
  • storm drpc实例
  • Vim 折腾记
  • windows下如何用phpstorm同步测试服务器
  • 从@property说起(二)当我们写下@property (nonatomic, weak) id obj时,我们究竟写了什么...
  • 从地狱到天堂,Node 回调向 async/await 转变
  • 你不可错过的前端面试题(一)
  • 判断客户端类型,Android,iOS,PC
  • 嵌入式文件系统
  • 小试R空间处理新库sf
  • 在weex里面使用chart图表
  • Oracle Portal 11g Diagnostics using Remote Diagnostic Agent (RDA) [ID 1059805.
  • ###51单片机学习(2)-----如何通过C语言运用延时函数设计LED流水灯
  • #FPGA(基础知识)
  • $ is not function   和JQUERY 命名 冲突的解说 Jquer问题 (
  • $.extend({},旧的,新的);合并对象,后面的覆盖前面的
  • (4)事件处理——(7)简单事件(Simple events)
  • (Git) gitignore基础使用
  • (ZT) 理解系统底层的概念是多么重要(by趋势科技邹飞)
  • (笔试题)合法字符串
  • (超简单)使用vuepress搭建自己的博客并部署到github pages上
  • (附源码)计算机毕业设计SSM基于java的云顶博客系统
  • (每日持续更新)信息系统项目管理(第四版)(高级项目管理)考试重点整理第3章 信息系统治理(一)
  • (十八)SpringBoot之发送QQ邮件
  • (十八)三元表达式和列表解析
  • .bat批处理(四):路径相关%cd%和%~dp0的区别
  • .NET Core 中插件式开发实现
  • .NET 中各种混淆(Obfuscation)的含义、原理、实际效果和不同级别的差异(使用 SmartAssembly)
  • .Net 转战 Android 4.4 日常笔记(4)--按钮事件和国际化