http://bugs.freedesktop.org/show_bug.cgi?id=20626
raoxianhong <raoxianh...@163.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #9 from raoxianhong <raoxianh...@163.net> 2009-03-17 04:57:23 PST --- (In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > The problem is solved by update mesa version. But I must DISABLE > > > GL_TEXTURE_GEN_R and GL_TEXTURE_GEN_Q to do it. If GL_TEXTURE_GEN_R or > > > GL_TEXTURE_GEN_Q is enabled, R200 looks line to object coord to normalized > > > (x/w, y/w, z/w, 1.0), it is same when I use with ATI's driver under > > > windows XP, > > > so it must be a limitation of R200. (and I get the same result on RADEON > > > X300, > > > X1300) > > I'm not sure I follow you there. If you get the same results on X300 and > > X1300 > > then possibly the results might be correct. Clearly if you disable > > GL_TEXTURE_GEN_R and GL_TEXTURE_GEN_Q results are expected to be different. > > In the example you gave, what coords do you get? > > The coords after texgen for your four vertices should be > > (1.0, 0.0, 2.0, 2.0) > > (1.0, 2.0, 2.0, 2.0) > > (0.5, 2.0, 2.0, 2.0) > > (0.25, 0.0, 1.0, 1.0) > > hence after the q divide (and ignoring the unused r coord) > > (0.5, 0.0) > > (0.5, 1.0) > > (0.25, 1.0) > > (0.25, 0.0) > > Is that different to what you get? > > Note that if you disable some of the texgen coords, the r200 _will_ produce > > bogus results in some cases, and I think it's generally a good idea to stay > > away from doing this > Oh, I forget the texture coordinates is homogeneous coordinates too, so the > texture corrdinates is used with TEXTURE_2D is (s/q, t/q) actually. > with object coordinate (x, y, z, w), the s, q texture coord is: > s = s1 * x + s2 * y + s3 * z + s4 * w > q = q1 * x + q2 * y + q3 * z + q4 * w > if we normalized object coordinate to (x/w, y/w, z/w, 1.0) > s' = s1 * x / w + s2 * y / w + s3 * z / w + s4 > q' = q1 * x / w + q2 * y / w + q3 * z / w + q4 > s/q = s'/q' > R200 is correct, and you. The real world is 3D world, we can only use three > indenpendent parameters talk with it. > But can I set q coordinate to 1.0f when I disable texgen Q? The bit R200_TEXGEN_FORCE_W_TO_ONE of the register R200_SE_TCL_TEX_PROC_CTL_0 may be used to set different Object coordinate for texgen. for vertex coordinate (x, y, z, w), if R200_TEXGEN_FORCE_W_TO_ONE is set, texgen get the texture coordinate as s = s1 * x + s2 * y + s3 * z + s4; q = q1 * x + q2 * y + q3 * z + q4; we set q1 = q2 = q3 = 0.0f and q4 = 1.0f and get q = 1.0f, thus we generate texture coordinate to s = s1 * x + s2 * y + s3 * z + s4; and vertex coordinate as (x, y, z, w). to do that, replace line 2421 of r200_state.c(mesa ver 7.2): tpc = (rmesa->TexMatEnabled | rmesa->TexGenEnabled); with tpc = (rmesa->TexMatEnabled | rmesa->TexGenEnabled) | R200_TEXGEN_FORCE_W_TO_ONE; any better result? -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel