Raytracing curve primitive

by syoyo

curve-render.png

http://github.com/syoyo/lucille/tree/master/rnd/FurRender

(source code)

Curve primitive(also known as Ribbon) has been used to represent fur, hair and thin geometry in conventional renderer such as PRMan.

Curve(ribbon) is facing always to viewer and have width.

The method for raytracing curve primitive was discoverd by Nakamaru and Ohno [1]

The image shown above is the initial result from my implementation of the metod.
In additon to calculating the intersection, UV coord at the intersection point are also computed and is shown as a color.

Nakamaru’s method is very simple and might not so slow, but I’ve found there are still many room for improving ray-curve intersection calculation over their method.
I have some ideas in my mind for fast ray-curve intersection calculation, but need to implement it and test it.

Details will be described later, hopefully 😉

[Ja]

中丸先į”ŸãŽã‚ĢãƒŧブをãƒŦイトãƒŦするã‚ĸãƒĢゴãƒĒã‚ēム [1] を RnD(Research&Development) としãĻ原čŖ…しãĻãŋぞした.
ä¸€åŽšãŽåš…ã‚’æŒã¤ãƒ™ã‚¸ã‚§æ›˛įˇšã‚’ãƒŦイトãƒŦでãƒŦãƒŗダãƒĒãƒŗグしãĻいぞす.
中丸先į”ŸãŽæ‰‹æŗ•ãĢ加えãĻ、äē¤į‚šãŽ UV åē§æ¨™ã‚‚垊元するようãĢしãĻãŋぞした. UV åē§æ¨™ã‚’ã‚Ģナãƒŧ化しãĻいぞす.
ãĄã‚‡ãŖと中åŋƒįˇšãĢã‚ĸãƒŧテã‚Ŗãƒ•ã‚Ąã‚¯ãƒˆãŒã‚ã‚Šãžã™ã­. 数値čĒ¤åˇŽã‚たりが原因でしょうか.

ã‚Ģãƒŧブは RenderMan では RiCurve ã‚ŗマãƒŗドとしãĻį”¨æ„ã•ã‚ŒãĻおり、
これは常ãĢ一厚嚅でčĻ–į‚šæ–šå‘を向くようãĢãĒãŖãĻいぞす. ãƒĒボãƒŗ(ribbon)ともå‘ŧばれãĻいるようです.
éĢĒãŽæ¯›ã‚„ãƒ•ã‚ĄãƒŧãĒおぎãƒŦãƒŗダãƒĒãƒŗグãĢ遊しãĻいぞす.

で、ã‚ĢãƒŧブをãƒŦイトãƒŦでやると、ãƒŦイトãƒŦã‚ˇãƒŖドã‚Ļや GI とぎįĩ„ãŋ合わせがよりč‡Ēį„ļãĢãĒる気がしãĻいぞす.

ã‚ĢãƒŧブぎãƒŦイトãƒŦå‡Ļį†ã¯ã€ã‚ˇãƒŗプãƒĢで劚įŽ‡įš„ã§ã‚ã‚‹ä¸­ä¸¸ãƒĄã‚ŊッドをäŊŋãŖãĻもしかしぞだ攚善ぎäŊ™åœ°ãŒã‚りぞす.
äģŠå›žãŽ initial 原čŖ…では、äŊ•ã‚‚最遊化しãĻいãĒいというぎもありぞすが、256×256, 1 Bezier curve で 3 sec くらいかかãŖãĻいぞす.
1 Bezier curve がį”ģéĸ全äŊ“で厚įžŠã•ã‚ŒãĻいるぎで、毎回äē¤į‚šã‚’æą‚ã‚ã‚‹ãŸã‚ãĢã‚Ģãƒŧブをį´°åˆ†å‰˛ã™ã‚‹å›žæ•°ãŒå¤šããĒãŖãĻしぞãŖãĻいるというぎが一į•Ēぎ原因かãĒ.
これぱクãƒĒãƒŧãƒŗ(ãƒŦイぎ斚向)ãĢ占めるã‚ĢãƒŧブぎéĸįŠãĢåŋœã˜ãĻあらかじめもう少しį´°ã‹ãã‚Ģãƒŧãƒ–ã‚’åˆ†å‰˛ã—ãĻおく、という手であるį¨‹åēĻ回éŋできるでしょう.

一åŋœé ­ãŽä¸­ã§ã¯ã‚ˆã‚ŠåŠšįŽ‡įš„ãĢã‚ĢãƒŧブをãƒŦイトãƒŦでãƒŦãƒŗダãƒĒãƒŗグするã‚ĸイデã‚ĸがいくつか思いついãĻいぞす.
頭ぎ中ãĢあるã‚ĸイデã‚ĸが原įžã§ãã‚Œã°ã€ãƒ•ã‚Ąãƒŧジã‚ĒãƒĄãƒˆãƒĒをãƒŦイトãƒŦでやるãģうが reyes ãĒおよりも劚įŽ‡įš„ãĢãĒり、
ãƒ•ã‚ĄãƒŧãƒŦãƒŗダãƒĒãƒŗグ時間がチョãƒŧįŸ­į¸Žã•ã‚ŒãĻしかも GI とも厚易ãĢįĩ„ãŋ合わせられãĻ、かつエイãƒĒã‚ĸ゚フãƒĒãƒŧ(ジãƒŖゎ様ãĒし)ãĢãĒる、、、、äēˆåŽšã§ã™ 🙂

ぞあ原際ãĢはホãƒŗトãĢそうãĒるかおうか、もう少しいろいろã‚ĸイデã‚ĸをã‚ŗãƒŧドãĢčŊとしãĻいろいろčŠĻしãĻãŋãĒいといけぞせん.

あとは houdini ãŽãƒ•ã‚Ąãƒŧ厚įžŠ(control point ベãƒŧã‚š)ãĒおとé€Ŗæēさせたいところ.

References

[1] Koji Nakamaru and Yoshio Ono, RAY TRACING FOR CURVES PRIMITIVE, WSCG 2002.

Advertisements