GithubHelp home page GithubHelp logo

minirt's Introduction

miniRT

My first RayTracer with miniLibX

minirt's People

Contributors

jinmugo avatar idealflower-k avatar

Watchers

 avatar

minirt's Issues

[Feature]: 파싱 값 범위 검사를 위한 함수 제작

Package Scope

Package name: parser

Overview

  1. (0.0 ~ 1.0)
  2. (0 ~ 255)
  3. (-1.0 ~ 1.0)

parser_utils 폴더에 범위 유효성 검사하는 함수를 각각 제작

  • check_0_to_1(double data);
  • check_rgb(t_rgb rgb);
  • check_minus1_to_1(double data);

Describe the solution you'd like

값의 유효성을 검사하여 true or false를 리턴합니다

Additional context

[Feature]: antialiasing apply

Package name: antialiasing

Overview

scene을 조금 더 사실적으로 보여주는 antialiasing을 적용합니다.

Describe the solution you'd like

지금까지는 하나의 카메라에서 나오는 ray만을 추적하였지만 이제는 random함수를 사용하여 불규칙적으로 좁은 범위의 ray들을 생성하여 물체와 물체 사이를 부드럽게 만듭니다.

Additional context

https://raytracing.github.io/books/RayTracingInOneWeekend.html#surfacenormalsandmultipleobjects/commonconstantsandutilityfunctions

  1. antialiasing을 참고 하여 만들 예정입니다.

[Feature]: Bonus part start!

Package name: Bonus

Overview

miniRT 보너스를 구현합니다.

  • Add specular reflection to have a full Phong reflection model
  • Color disruptio: checkerboard.
  • Colored and multi-spot lights.
  • One other 2nd degree object: Cone
  • Handle bump map texutres.

Describe the solution you'd like

4번 2nd degree object는 Cone을 구현합니다. -> Oloid를 구현하기 위한 빌드업.

처음에는 각자 하나씩 맡고 시작합시다!
jgo: 3번.
sanghwal: 4번.

Additional context

[Refactor]: mandatory Refactoring

Overview

그동안 구현했던 코드에 norm을 적용하고 refactoring합니다.

  • parse
  • render
  • light
  • error
  • libtensor
  • hooks
  • color

Describe the solution you'd like

연산량을 최대한 줄이기, norm 적용, static 함수 naming 맞추기.

[Feature]: 프로젝트 관리를 위한 여러가지 workflow추가.

Package Scope

Package name: project-automation.yaml

Overview

프로젝트 tab [Projects]에 attach하지 않았을 때나 , issue를 등록했을 때 적절한 label을 추가하고 삭제하는 workflow입니다.

Describe the solution you'd like

아직 해당 workflow에 대한 이해가 온전하지 않기 때문에 여러가지를 시도해볼 예정입니다.

Additional context

https://github.com/actions-cool/issues-helper
https://github.com/leonsteinhaeuser/project-beta-automations

[Feature]: RGB to RGBA

Package Scope

Overview

dev브랜치와 이전에 merge한 parser브랜치에 rgb로 적용 되어 있어서 issue #12 의 작업이 완료된 branch와 현재 dev브랜치를
merge하려고 합니다.

Describe the solution you'd like

dev브랜치의 모든 t_rgb를 t_rgba로 변경하고

double a; 필드를 추가할 예정입니다.
그리고 관련된 함수들도 모두 변경예정입니다.

Additional context

#12

[Feature]: MLX42 library -> minilibx_opengl

Package name: minilibx_opengl

Overview

서울 캠퍼스에서 mlx42를 제한함에 따라 과제에서 제공하는 minilibx_opengl 을 사용하려 합니다.
이와 관련해서 다음과 같은 파일들이 수정될 예정입니다.

color, hoook, render, singleton, etc)......

Describe the solution you'd like

mlx42 관련 함수들을 제거하고 이를 사용하는 함수,파일들을 모두 수정합니다.

Additional context

https://42born2code.slack.com/archives/CU6MU5TB7/p1689171692934769?thread_ts=1689136166.494269&cid=CU6MU5TB7
https://42born2code.slack.com/archives/CU6MU5TB7/p1689136166494269

[BUG]: .rt 인자로 들어온 방향벡터값 처리 과정 수정.

Package Scope

Package name: parse

Describe the bug

현재 .rt파일에 들어있는 방향 벡터들을 모두 정규화 하여 사용하고 있습니다. 이런 처리 과정 때문에 서브젝트에 명시되어있는 [-1,1]의 범위를 초과해도 실행이 되고 있습니다. 이런 문제를 해결 하기 위해 해당 normal vector들은 모두 normalized된 값들이기 때문에 정해진 규칙을 지켜 작성되도록 유도 하겠습니다.

Expected behavior

위 동작을 통해 기대되는 효과는 다음 두 가지 입니다.

  1. 서브젝트에 명시되어있는 normalized된 값들만 받게끔 합니다.
  2. 불필요한 unitize를 없애 [-1,1]의 범위를 초과하지 않게끔합니다.

To Reproduce

Possible Solution

인자를 unitize 하지 않고 이미 단위 벡터가 되어있는 벡터만 받게끔 처리할 수 있습니다.

Additional context

[Refactor]: object 파싱 구조 변경

Package Scope

Package name: parser

Overview

objects 렌더링을 위해 파싱 구조변경
union u_obj 생성
struct s_obj 구조 변경

Describe the solution you'd like

object 의 type변수를 밖으로 빼내서 확인 가능하게 변경

Additional context

[Feature]: bump map textures

Package name: bump map

Overview

bump map texture를 추가하여 rendering합니다.

Describe the solution you'd like

MLX는 texture input을 받을 수있는 xpm, png확장자가 있기 때문에 이 두개의 파일을 활용해서
bump map을 구현할 것입니다.
이 과정에서 우리가 그려내는 world좌표계에 이미지 파일들을 remapping해야 합니다.

Additional context

https://en.wikipedia.org/wiki/Bump_mapping
https://github.com/codam-coding-college/MLX42/wiki

[Feature]: Renderer 함수 및 object 그리기.

Package name: Renderer

Overview

Objects들을 Render할 것입니다. mandatory의 기본 objects들은 다음 세가지 입니다.

  1. Sphere
  2. Plane
  3. Cylinder

1 ~ 3 순서대로 구현할 예정입니다.

  • Sphere
  • #21 Plane
  • Cylinder

Describe the solution you'd like

main -> renderer -> obj_list를 확인한 후 해당 object를 render하는 방식.

각 object마다 file하나씩을 배정받습니다.

Additional context

mandatory, bonus refactoring

Refactor Request

mandatory와 bonus part모두 구현을 완료하였습니다. 이제는 norminette을 맞추고 refactoring을 해봅시다.

Description of the proposed solution

주요 refactoring안건들은 다음과 같습니다.

  • vec3의 연산비용 줄이기.
  • color와 vec3의 포지션이 겹치기 때문에 color를 vec3로 연산하도록함.
  • 각자 구현했던 부분 최적화. ex) 로직상 중복되는 부분을 결합
  • double -> float
  • rendering 속도 향상.
  • parsing 예외처리 확인 및 추가

ps. 각각 refactor/#53-mandatory-bonus-{1..5}와 같은 이름으로 만들어서 진행해주세요.

Additional context

[Feature]: plane 렌더링 함수

Package Scope

Package name: render

Overview

plane 유형 관련된 렌더링 함수 구현

Describe the solution you'd like

Additional context

ascii to double 함수 구현

Package name: parser

Overview
.rt 확장자 파일로 들어오는 소수점 문자열을 double형으로 변환하는 double atod(char *str)함수 구현
double check_to_double(char *str) 함수를 만들어서 문자열을 한번 검사하여 atod() 호출('.'가 여러개 이거나 숫자가 아닌 문자 확인용)

Describe the solution you'd like
두 함수를 거쳐 하나의 double 형을 리턴한다.

Additional context
The structures and functions used are defined on the notion page.

[Feature]: tensor library 만들기

Package Scope

Package name: libtensor

Overview

vector와 matrix 생성, 연산, 소멸 하는 libary를 만들예정.

Describe the solution you'd like

  • vector
  • 생성자
  • 연산자
  • matrix
  • 생성자 (optional)
  • 연산자 (optional)

[BUG]: specular적용 되지않음.

Package Scope

Package name: phong_lighting

Describe the bug

phong_lighting 조명 모델 중 specular가 적용되지 않는 문제가 있습니다.

Expected behavior

광원의 거리와 색상을 반영하여 해당 조명에 조금 더 좁은 각도를 가진 벡터가 더 밟게 픽셀이 계산되어야 하는데 되지않는 문제가 있습니다.

Possible Solution

다른 ray구조체를 넘겨주고 있는 것을 확인하여 해결할 수 있을 것 같습니다.

Additional context

[Feature]: Implementing a Parsing

Package Scope

  • New package

Package name: parser

Overview

  • Receives files with a ".rt" extension.
  • Splits elements based on one or more line breaks.
  • Splits element types based on one or more spaces.
  • Validates the type.
  • If an incorrect configuration is found, the program terminates and returns "Error\n" along with a clear error message.

Describe the solution you'd like

  • Stores the data obtained through parsing in a t_meta
  • Handles errors appropriately.

Additional context

  • The structures and functions used are defined on the notion page.

dependence on this issue

[Feature]: 화면 렌더링을 위한 thread 추가.

Package name: thread

Overview

scene렌더링을 위한 thread를 추가합니다.

Describe the solution you'd like

각 화면을 thread의 숫자로 나누어 각각 독립적으로 rendering을 하도록 합니다.

Additional context

[Feature]: Camera, Canvas 구현 (yet Object)

Overview

카메라와 캔버스 구조체, 파일 등을 만들예정입니다.

Describe the solution you'd like

MLX42 API를 이용해서 오브젝트를 그리기 전까지만 setup할 예정입니다.

Additional context

[BUG]: Camera up vector 오류.

Package Scope

Package name: setup_scne

Describe the bug

현재 카메라의 기본 up vector를 0,1,0으로 설정하고 있습니다. 다른 경우에서는 오류가 나지 않지만 카메라의 방향벡터가 0,1,0 혹은 0,-1,0일 경우에 up vector와 기본 카메라의 방향벡터가 일치 하기 때문에 카메라가 원하는 곳을 바라보지 못하는 경우가 생깁니다.

지금 우리의 좌표계는 오른손 좌표계를 사용하고 있기 때문에 만약 위의 두가지 케이스가 들어온 경우 카메라의 기본 up vector를 각각
0,0,1 과 0,0,-1로 설정하여 인자값으로 들어온 방향을 향하게 해야합니다.

Expected behavior

0,1,0 그리고 0,-1,0이 들어왔을 경우 y축을 제대로 바라보고 있어야 합니다.

To Reproduce

static inline t_vec3	_camera_judge_up_vector(t_camera *camera)
{
	if (is_vec3_same(camera->forward, vec3_init(0, 1, 0)))
		return (vec3_init(0, 0, 1));
	if (is_vec3_same(camera->forward, vec3_init(0, -1, 0)))
		return (vec3_init(0, 0, -1));
	return (vec3_init(0, 1, 0));
}

Possible Solution

인자를 확인하여 up vector 를 수정하는 방향이 있습니다.

Additional context

[Feature]: hooks 추가

Package name: hooks

Overview

Camera를 움직이는 hook 함수 추가.

Describe the solution you'd like

기존 함수들에 존재하던 pitch와 yaw 값을 이용하여 front를 조작한뒤 카메라가 보고있는 viewport를 변경합니다.

또한 키보드 입력을 받아 camera의 pos를 움직입니다.

Additional context

[Feature]: parser struct, enum 세팅

Package Scope

  • Add to an existing package

Package name: parser

Overview

t_meta
t_rgb
t_ambient
t_camera
t_light
t_sphere
t_plane
t_cylinder
구조체 추가 및 수정

e_object_type에 AMB, CAM, LIGHT, SP, PL, CY 타입 추가

Additional context

중복된 기존 구조체는 주석처리 했습니다.

[Feature]: hook 점검.

Package name: hooks

Overview

프로젝트의 mlx hooks에 관한 것들을 점검합니다.

Describe the solution you'd like

window가 resize되었을 때 해당 resolution에 맞추어 다시 렌더링 하도록 수정합니다 .
현재 camera의 방향 벡터를 마우스를 통해 수정할 수 있습니다. 하지만 초기 값으로 돌아오는 동작을 할 수 없기 때문에
키보드 R 입력을 통해 카메라의 방향 벡터를 처음받은 방향벡터로 초기화 할 수 있도록 추가할 예정입니다.

Additional context

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.