When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
69 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
#include "rtweekend.h"
#include "camera.h"
#include "color.h"
#include "hittable_list.h"
#include "material.h"
#include "sphere.h"
int main() {
hittable_list world;
auto material_ground = make_shared<lambertian>(color(0.8, 0.8, 0.0));// floor colour
auto material_center = make_shared<lambertian>(color(1.0, 0.0, 0.0));//middle circle colour
auto material_left = make_shared<metal>(color(0.0, 1.0, 0.0));//left circle colour
auto material_right = make_shared<metal>(color(0.0, 0.0, 1.0));//right circle colour
world.add(make_shared<sphere>(point3(0.0, -100.5, -1.0), 100.0, material_ground));
world.add(make_shared<sphere>(point3(0.0, 0.0, -1.0), 0.5, material_center));
world.add(make_shared<sphere>(point3(-1.0, 0.0, -1.0), 0.5, material_left));
world.add(make_shared<sphere>(point3(1.0, 0.0, -1.0), 0.5, material_right));
camera cam;
cam.aspect_ratio = 16.0 / 9.0;
cam.image_width = 400;
cam.samples_per_pixel = 100;
cam.max_depth = 50;
cam.render(world);
}
main.cpp
Learn about Phong shading.
is it hard?
No.
ok. ill try.
but im kinda in a hurry. so i hope it doesnt take long
also im a beginner so im not sure if im able to implement the math properly
i still dont know how to do phong shading.
was doing something else. sorry
could you help with an example?
I just want to get this done quick. I’ll understand it later.
there's no point in doing this quick and trying to understand it later
you either understand it and do it, or you don't
i'm also not quite sure what exactly you're looking for
i need to write some code so the spheres can have a specular reflection
its getting pretty late and i want it to be done before i go
what kind of specular reflection exactly?
like reflecting light
um
ill show a picture
your spheres already look reflective
isn't that gonna look weird to have a white spot on top of a real reflective surface there?
because it's not how things look in reality
im not trying to achieve realism right now.
well, I mean, the picture up there is almost certainly using phong shading
so you'd just implement that then
formula's on wikipedia 🤷♂️
this one isnt my sphere
yes
the first one is mine. it doesnt have phong shading i dont think.
it doesn't
what I'm saying is that if you want your spheres to look like this one, you need to implement phong shading. because that's how you get that result.
im not sure how to implement it though.
well, read up on how it works and then implement it, like you did with your spheres up there 🤷♂️
the thing is i wasnt trying to understand it. i was just copying and pasting
well, then you'll have to go and actually understand it first
do i have to?
I mean you don't have to I guess
could you help me out so it can go quicker?
but if you want to implement this thing you want to implement, understanding what you're doing will be necessary
yeah i know. ill have to understand this if i want to build my own. but thats not what i want to do right now.
well, the fact that you want smth isn't gonna change anything about the fact that you still need to go and do it
fine ill read about it but i dont think im gonna understand it.
that probably means you'll have to go further back and catch up with yet more basics that you likely skipped along the way as well
I cannot just snip my fingers and make you understand stuff. you can only do that yourself, through study and practice.
im not trying to understand it though.
without understanding it, you won't be able to do it though.
thats what i did for my old code.
well, and now you see how far that got you. this is the point where skipping on actually understanding what you're doing has caught up with you, and where you'll just have to go and actually work on understanding what you're doing.
not sure what else you want me to tell you
can you just type it for me so i can go to sleep?
no
ffine ill read.
that would be a waste of both our time
wouldnt even take that long for you.
it likely wouldn't. it would still be a waste of time since you're not even trying to actually understand what's going on. what would be the point?
ill understand it later when i have the time
also i havnt learned nothing while building this project
thank you for trying to help anyway
@cobalt aspen Has your question been resolved? If so, type !solved :)