smooth shading a quad

Started by
15 comments, last by Xero-X2 18 years, 7 months ago
What it looks like is that it's either fairly old hardware or a software rasteriser. Haven't seen a picture like that in a while.

It looks like the colours are being interpolated in screen space, rather than in a perspective correct fashion, like in the bad old days.

One visually pleasing solution to this is to use a 1 dimensional texture that goes from white to blue, and pass texture coordinates instead of vertex colours. Assuming of course the texture will be perspective correct, but you have to hope it would be.

- Phil
Advertisement
Quote:
One visually pleasing solution to this is to use a 1 dimensional texture that goes from white to blue, and pass texture coordinates instead of vertex colours. Assuming of course the texture will be perspective correct, but you have to hope it would be.


If the color interpolation is not perspective-correct, neither will be the texcoord interpolation.

mike74, what are your specs(mainly video card)?
I have an ATI 3D RAGE PRO AGP 2X.

BTW, it seems like texture coordinate interpolation does work correctly even though the color interpolation does not seem to.

mike
http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
I tried it at the library, and it behaves the same way. So, I don't think it's an error with the graphics card.

You can download the exe and source from http://www.coolgroups.com/blockmaze.zip. If you guys could tell me how it works on your computers, that would be great.

Thanks.

mike
http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Works flawlessly on my machine(GFX5200):

Image Hosted by ImageShack.us

On the other hand, when I force OpenGL to fallback into software mode(set my video settings to 16bpp and require and alpha channel), I also get seams as you described. Try adding this line in your code:

printf("Renderer: %s",glGetString(GL_RENDERER));

If you get "GDI Generic", then that's the problem. The generic implementation of OpenGL is not very good, and probably doesn't handle perspective-correct interpolation(glHint(GL_PERSPECTIVE_CORRECT_HINT,GL_NICESTS) is merely a suggestion to the server, it can be ignored depending on the implementation).

[Edited by - mikeman on September 2, 2005 11:18:38 AM]
ATI Radeon 9600 Pro, 5.8 drivers, works flowlessly (no visible seam).

No-seams Image

(How do I linkify? The faq does not mention anything!)

EDIT: Thanks Xero-X2! Rectified the problem.

[Edited by - Fiddler on September 4, 2005 6:39:07 PM]

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

you just use Html. tho I get an error when tryin to use it that url =D
"I seek knowledge and to help those who also seek it"

This topic is closed to new replies.

Advertisement