From: <no...@so...> - 2001-06-29 14:54:06
|
Bugs item #437376, was opened at 2001-06-29 07:46 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100003&aid=437376&group_id=3 Category: GLU Group: Rendering Error Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect lighting for NURBS surface Initial Comment: Mesa version: 3.5 (using SI-GLU) Nurbs surfaces are incorrectly lighted. A few rectangles of the mesh are wrongly shaded. The number and position of the stains depends on the size and orientation of the surface. This didn't happen with Mesa 3.4.x. [This bug is different from #212069.] MESA_INFO gives: X/Mesa visual = 0x8050c88 X/Mesa dithered pf = 13 X/Mesa undithered pf = 6 X/Mesa level = 0 X/Mesa depth = 16 X/Mesa bits per pixel = 16 X/Mesa visual = 0x8050c88 X/Mesa dithered pf = 13 X/Mesa undithered pf = 6 X/Mesa level = 0 X/Mesa depth = 16 X/Mesa bits per pixel = 16 Mesa GL_VERSION = 1.2 Mesa 3.5 Mesa GL_RENDERER = Mesa X11 Mesa GL_VENDOR = Brian Paul Mesa GL_EXTENSIONS = GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_transpose_matrix GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_logic_op GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_convolution GL_EXT_compiled_vertex_array GL_EXT_fog_coord GL_EXT_histogram GL_EXT_packed_pixels GL_EXT_paletted_texture GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_shared_texture_palette GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_object GL_EXT_texture_lod_bias GL_EXT_vertex_array GL_HP_occlusion_test GL_INGR_blend_func_separate GL_MESA_resize_buffers GL_MESA_window_pos GL_NV_blend_square GL_NV_texgen_reflection GL_SGI_color_matrix GL_SGI_color_table GL_SGIS_generate_mipmap GL_SGIS_pixel_texture GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIX_depth_texture GL_SGIX_pixel_texture GL_SGIX_shadow GL_SGIX_shadow_ambient Mesa thread-safe: YES Mesa x86-optimized: YES Mesa sparc-optimized: NO There is also some output: arc_ccw_turn, p = 0 case b arc_ccw_turn, p = 0 case d arc_ccw_turn, p = 0 case a arc_ccw_turn, p = 0 case c [...] Example: #include <cmath> #include <cstdlib> #include <GL/glut.h> double wx = 0; // rotation along x-axis double wy = 0; // rotation along y-axis double s = 1; // scaling factor GLUnurbsObj* nobj; void init() { GLfloat light0[4] = { 0.0, 0.0, 10.0, 1.0 }; glLightfv (GL_LIGHT0, GL_POSITION, light0); glEnable (GL_LIGHT0); glEnable(GL_DEPTH_TEST); glEnable(GL_AUTO_NORMAL); glEnable(GL_NORMALIZE); glEnable(GL_LIGHTING); nobj = gluNewNurbsRenderer(); } void draw() { /* knot vectors */ GLfloat U[12] = { 0, 0, 0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1, 1, 1 }; GLfloat V[8] = { 0, 0, 0, 0.5, 0.5, 1, 1, 1 }; /* control points */ GLfloat a = 0.5*sqrt(2); GLfloat b = 0.5; GLfloat P[45][4] = { {1, 0, 0, 1 }, {a, a, 0, a}, {0, 1, 0, 1}, {-a, a, 0, a}, {-1, 0, 0, 1}, {a, 0, 0, a }, {b, b, b, b}, {0, a, a, a}, {-b, b, b, b}, {-a, 0, 0, a}, {1, 0, 0, 1 }, {a, 0, a, a}, {0, 0, 1, 1}, {-a, 0, a, a}, {-1, 0, 0, 1}, {a, 0, 0, a }, {b, -b, b, b}, {0, -a, a, a}, {-b, -b, b, b}, {-a, 0, 0, a}, {1, 0, 0, 1 }, {a, -a, 0, a}, {0, -1, 0, 1}, {-a, -a, 0, a}, {-1, 0, 0, 1}, {a, 0, 0, a }, {b, -b, -b, b}, {0, -a, -a, a}, {-b, -b, -b, b}, {-a, 0, 0, a}, {1, 0, 0, 1 }, {a, 0, -a, a}, {0, 0, -1, 1}, {-a, 0, -a, a}, {-1, 0, 0, 1}, {a, 0, 0, a }, {b, b, -b, b}, {0, a, -a, a}, {-b, b, -b, b}, {-a, 0, 0, a}, {1, 0, 0, 1 }, {a, a, 0, a}, {0, 1, 0, 1}, {-a, a, 0, a}, {-1, 0, 0, 1} }; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glRotated(wy,0,1,0); glRotated(wx,1,0,0); glScaled(s,s,s); gluBeginSurface(nobj); gluNurbsSurface(nobj, 12, U, 8, V, 5*4, 4, &P[0][0], 3, 3, GL_MAP2_NORMAL); gluNurbsSurface(nobj, 12, U, 8, V, 5*4, 4, &P[0][0], 3, 3, GL_MAP2_VERTEX_4); gluEndSurface(nobj); glPopMatrix(); glutSwapBuffers(); } int main(int argc, char **argv) { if (argc>=4) { s = atof(argv[1]); wx = atof(argv[2]); wy = atof(argv[3]); } glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize(600,600); glutInitWindowPosition(0,0); glutCreateWindow(argv[0]); glutDisplayFunc(draw); init(); glutMainLoop(); return 0; } ---------------------------------------------------------------------- Comment By: Joachim Reichel (reichel) Date: 2001-06-29 07:54 Message: Logged In: YES user_id=28760 Oops, wasn't logged in. Submitted by: Joachim Reichel (reichel) Email: joa...@gm... ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100003&aid=437376&group_id=3 |