UMLComputerGraphics / GraphicsProject

UML Graphics 2 Final Project 2013
7 stars 1 forks source link

Raytracer does not play nice with .mtl files #82

Closed jnsnow closed 11 years ago

jnsnow commented 11 years ago

http://i.imgur.com/Um1GfFd.jpg?1

raytraceIntegrated is currently configured to load an object into the scenegraph, then buffer it using the RayTracer class, then render those things with the raytracer shader.

It "works" with materials that are colored randomly without materials files, because Object::bufferToRaytracer will use "default" values for materials properties if it has colors but not material properties.

If I enable the material loading (in main for raytraceIntegrated), the bottle becomes only partly visible.

Tagging @ImperatorFeles and @soujiroboi In the hopes that they know more about how to fix this, I'm not well aware currently on what or why this is behaving as such.

soujiroboi commented 11 years ago

What can we encode in the mtl files? I'm sure we could reuse diffuse, ambient, specular, and shininess

The reflect and refract values are kind of made up. Well refract is supposed to be the refraction index. Reflect is a value between 0 and 1 and represents the amount the object reflects.

jnsnow commented 11 years ago

from Object.cpp, line 845;

If the materials file is present, it attempts to use the diffuse, ambient, specular, shininess and refractiveness of the object, though those numbers may not mean the same thing to both systems.

Any input, @ImperatorFeles ?

ImperatorFeles commented 11 years ago

I'm not what "shininess" should actually affect in the system, but the rest should be there and usable. I'm not sure how to set either ambient or or refract in blender, so if we need these we may have to edit the .mtl file manually or use some default values.

soujiroboi commented 11 years ago

Both views use the phong so diffuse, ambient, specular, and shininess should work as expected. We can default ambient to black. Since we only need the bottle to refract we should find a way to set that.

nuclearmistake commented 11 years ago

Is the fragment color determiner phonging hard? or is it still expecting a color vec4 to exist?

nuclearmistake commented 11 years ago

it's a bit better now... still no textures, but things look like things.