Header

  1. View current page

    Hybrid의 노트

Profile_img_60x60_01
0

CL Raytracer

Sourceforge

https://sourceforge.net/projects/cl-raytracer/

 

https://sourceforge.net/projects/cl-raytracer/files/ : (소스 압축) 이곳에서는 약간의 테스트를 거친 후 배포하고(소스는 여전히 지저분~)

https://sourceforge.net/projects/cl-raytracer/develop : (SVN) 이곳에서는 작성 중인 코드를 그대로 받을 수 있음.

https://sourceforge.net/projects/cl-raytracer/forums/forum/1116757/topic/3645981 : 질문이나 이슈들은 이곳에서..

 

주의 : SVN 코드는 실행 자체이 안된 코드가 올라가 있을 수 있음.

 

소스 설명

vector.lisp : 기본적인 벡터 연산

math.lisp : 수학 함수들

raytracer-utility.lisp : 파일로 저장하기 등 기타 유틸리티 함수들

raytracer-implementation.lisp : raytracing 에 관한 계산

primitive.lisp : ray, 구, 삼각형에 대한 함수들

scene.lisp : scene 과 카메라에 대한 함수들

raytracer.lisp : 레이트레이서(메인), 테스트 코드 포함

(소스는 스프링노트가 아닌 소스포지를 통해 공개함)

자료 구조

; vector : (x y z)

; color : (r g b)

; screen : (width height)

; camera : (position direction updirection fovy)

-> position/direction/updirection 은 모두 vector 임

; ray : (origin direction length)

; scene(sphere) : ( background-color global-ambient (sphere ... ) )

; sphere : (position radius material)

; color : (r g b)

; color-set : (ambient diffuse specular)

; material : (ambient diffuse specular shininess)

; result : ( (width height) (color ...) )

-> width first

 

구현 순서

  1. 기본 구조 만들기. 
  2. 구/삼각형과 레이의 교차 테스트 만들기
  3. 실제 렌더링 화면을 리스트로 저장(이 데이터는 당분간은 다른 언어로 짠 프로그램으로 이미지를 만들어야 할듯)
  4. 간단한 쉐이딩 연산
  5. 여러개의 구 혹은 여러개의 삼각형과의 렌더링(씬의 구조가 잡힘)
  6. 특정 씬에 대해서 KD-Tree 를 생성
  7. KD-Tree 의 정보를 이용해서 렌더링
  8. (이건 순서가 앞당겨 질 수 있음) 이미지 파일로 출력

    여기부터는 구현이 안될 수 있음.

  9. 실제 다른 곳에서 쓰이는 Scene 파일을 로드(최대한 간단한거)
    Scene 파일 -> Lisp Scene -> 렌더링 -> Lisp 이미지 -> 이미지 파일
  10. Scene 정보에서 재질 정보를 얻와서 렌더링에 사용함

 

 

History

Last edited on 03/29/2010 14:22 by Hybrid

Comments (0)

You must log in to leave a comment. Please sign in.