#Broken ray tracer

3 messages · Page 1 of 1 (latest)

faint jewel
#

Hello,
I've been programming in C++ for about 2 years.
I am currently coding my biggest programming project : a ray tracer from scratch only using the standard C++ library.

My latest change was to add support for .mtl files.
Note that my code worked perfectly before making this change.

If you don't know, .mtl files go with .obj files.
They basically serve as "material" files and notably allow support for multiple texture files.

Unfortunately, this change broke my rendering system.
Now, depending on the model I'm using, I'm either getting black artifacts or a completely green render.

Obviously I spent some time debugging to find where this could be coming from but I just couldn't find it.
The green render image means that my code detects collisions for every ray but doesn't see any texture file associated to the triangle's material.

The fact that these artifacts are random ( they change each time you run the code ) makes me think that this must be a memory initialization issue.

So if you know a little about ray tracing, please take a look at my code and tell me if you find anything !

https://github.com/Swann7777777/pathTracer

I know I should add comments to my code and I swear I'll do it at some point.

GitHub

Contribute to Swann7777777/pathTracer development by creating an account on GitHub.

fringe frigateBOT
#

When your question is answered use !solved or the button below 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.

brazen pike
#

narrow down the suspects first, you cannot possibly just ask someone to grep your whole codebase for you.