如何设置光线和材质以获得翡翠物体
how set light and materials to obtain an emerald object
当我在 opengl 中为对象 (glutSolidSphere(2.,10.,8.);) 设置 material 时,例如翡翠参数:
float[] mat_ambient ={ 0.0215f, 0.1745f, 0.0215f, 0.55f };
float[] mat_diffuse ={0.07568f, 0.61424f, 0.07568f, 0.55f };
float[] mat_specular ={0.633f, 0.727811f, 0.633f, 0.55f };
float shine = 76.8f;
为了获得真正的翡翠物体,我应该以同样的方式设置光的成分吗?我的意思是:
float[] light_ambient ={ 0.0215f, 0.1745f, 0.0215f, 0.55f };
float[] light_diffuse ={0.07568f, 0.61424f, 0.07568f, 0.55f };
float[] light_specular ={0.633f, 0.727811f, 0.633f, 0.55f };
浮动[] light_position= { 1.0, 1.0, 1.0, 0.0 };
结果不好...
如果你想用Blinn–Phong reflection model and Gouraud shading you have found the answer. However, you can't do anything more realistic with the 20-year-old OpenGL Fixed-Function pipeline. Same reason as in the comments on your previous question How can I do a brass surface?渲染一个绿色表面。
与 Phong shadding where it is computed per fragment. Use a higher resolution on the sphere to improve lighting and get some specular highlights. See GLSL fixed function fragment program replacement and .
相比,使用 Gouraud 着色时,灯光模型是按顶点计算的
当我在 opengl 中为对象 (glutSolidSphere(2.,10.,8.);) 设置 material 时,例如翡翠参数:
float[] mat_ambient ={ 0.0215f, 0.1745f, 0.0215f, 0.55f };
float[] mat_diffuse ={0.07568f, 0.61424f, 0.07568f, 0.55f };
float[] mat_specular ={0.633f, 0.727811f, 0.633f, 0.55f };
float shine = 76.8f;
为了获得真正的翡翠物体,我应该以同样的方式设置光的成分吗?我的意思是:
float[] light_ambient ={ 0.0215f, 0.1745f, 0.0215f, 0.55f };
float[] light_diffuse ={0.07568f, 0.61424f, 0.07568f, 0.55f };
float[] light_specular ={0.633f, 0.727811f, 0.633f, 0.55f };
浮动[] light_position= { 1.0, 1.0, 1.0, 0.0 };
结果不好...
如果你想用Blinn–Phong reflection model and Gouraud shading you have found the answer. However, you can't do anything more realistic with the 20-year-old OpenGL Fixed-Function pipeline. Same reason as in the comments on your previous question How can I do a brass surface?渲染一个绿色表面。
与 Phong shadding where it is computed per fragment. Use a higher resolution on the sphere to improve lighting and get some specular highlights. See GLSL fixed function fragment program replacement and