Find Jobs
Hire Freelancers

Ray Tracing in OpenGL (c++)

$30-120 USD

Em Andamento
Publicado há mais de 19 anos

$30-120 USD

Pago na entrega
This program will create a ray-tracer that renders a snowman. this program will ray-trace a simple scene with your snowman sitting in an open field. The field will be created using a horizontal plane for the ground. Your scene should be lit from above and at a slight angle (say, 3pm on a winter's day) so that the shadows of each ball falls on the ball below it and also creates a shadow on the ground plane. You may assume that the ground plane does not make a shadow on the snowman. The illumination should follow the Phong model and should contain diffuse, specular highlighting, and ambient components. The ray tracing algorithm must include two types of shadows that are caused by the sphere objects blocking the light source. The first type of shadow is a hard shadow, the second a soft shadow. The program toggles between the two using the 's' key. The hard shadow follows along with the ray-tracing as described in the lectures. The soft shadows are a bit more fancy: The soft shadow will be created using a simple trick that randomly makes small modifications to the shadow ray before computing the shadow collisions (i.e. checking visibility of the intersection point with the light.) Some care will need to be taken not to make the modifications too large, or too small. New random numbers for each shadow ray will cause shadow variation from pixel to pixel specifically near the edges of the shadowed region. Be careful when computing the illumination not to use the modified shadow ray for the light ray (because you don't want to make the modifications to the lighting - only to the shadow visibility calculation.) Instead, use the correct (unmodified) ray for the light vector and illumination. see Deliverables for details ## Deliverables **Implementation:** you will be use OpenGL only to turn pixels on, this time to their proper color. You will modify the write_pixel function to add color as below: ![][1] where r,g,b correspond to red, green, and blue components of color. You may "hard-code" information about objects (spheres and the ground plane), materials and the light source. A simple background color (maybe, skyblue or an 'overcast' gray) should be set when a ray doesn't hit any objects in the scene. When 's' is pushed, toggle the scene to the 'other' shadow type. To do this quickly, I recommend you compute both soft and hard shadow images simultaneously and store the pixel info in an array. Then, simply show the right array when the button is pushed, rather than recomputing all new values. Note: To receive full credit you will need to make certain that your image includes some place which shows partial shadowing between two (or more) spheres. This means on some sphere (say the base of the snowman) there should be some part that is in light *and* some part that is in shadow. You will lose no credit by making the snowman to your own personal taste. Give it eyes or a hat, make it green or fat, add ears like a cat. HINTS: This program may run slowly on a slow machine. To speed up the debug process, test only one sphere and use a very small test image (like 10x10 pixels!) until you are certain the basic parts work. Then make the test image larger (now 30x30) and add a ground plane until you see that the shadows, etc. work. Finally, make the image more reasonably sized (100x100) to make/set the scene and don't do the full blown image until the very end. Of course, *do* test the full resolution before you turn it in. Credit will be broken down as follows, rendering the spheres with phong (specular, diffuse, ambient) lighting is 30 pts, adding and lighting the ground plane (20 pts), working hard shadows is 20 pts, working soft shadows 20 points. And the last 10 points is for neat code and documentation. Want more? Okay, you will be given 20 extra points for adding in smooth bump mapped "wiggles" to the spheres of the head and body. This must be smooth (i.e. you need a random field so that the normal over the surface changes slowly and uniformly, not just as a random number for every collision) It should look like the surface of the sphere has small pertubations on it that make it wavy. No visible seems should appear in the final images. This is not for the weak of heart and will be graded all or nothing. More details are available if you want, just ask. 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform Operating System: Linux C++
ID do Projeto: 3438944

Sobre o projeto

1 proposta
Projeto remoto
Ativo há 20 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$102 USD em 12 dias
5,0 (6 avaliações)
2,5
2,5

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
5,0
3
Membro desde out. 28, 2004

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.