Displaced plane looks fine on NVIDIA, has cracks on ATI

Hi,

my program does some simple displacement mapping using a vertex shader.
It works fine on NVIDIA chips, but not on ATI chips.

Here is the source code and the binary:
http://www.timosoft-software.de/stuff/dmtest.zip
The program uses the NeHe framework. I know that the NeHe samples partly
are of poor quality, but the problem also exists in a more complex
program that doesn't use the NeHe framework, so it must be *my* code
that's wrong.
The interesting things happen in DMTest.cpp. I load the textures, setup
a VBO for drawing a plane consisting of 240k vertexes and setup the
shaders. When drawing, I activate the shader program, load the color map
to texture unit 1 and the displacement map to texture unit 0, setup the
camera, and draw using the VBO.
The vertex shader reads from the (colored) displacement map, grayscales,
and displaces the vertex using the gray value:

gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
vec4 dv = texture2D(displacementMap, gl_MultiTexCoord0.xy);
float displacement = 0.30 * dv.x + 0.59 * dv.y + 0.11 * dv.z;
vec4 newVertexPos = vec4(gl_Normal * displacement * 100.0, 0.0) + gl_Vertex;
gl_Position = gl_ModelViewProjectionMatrix * newVertexPos;

This is what it looks like on my ATI Radeon HD3300 (Windows Vista x64)
and on an ATI Radeon HD4670 (Windows XP x64):
http://www.timosoft-software.de/stuff/dmtest.png
As you can see, there are cracks. Those cracks aren't there on a NVIDIA
Geforce 8800 GTS (Windows XP), 7300 GT (Windows XP) and 8800 GTX
(Windows Vista x64).
How do I make this work correctly on ATI? I've already tried different
drivers (8.12, 9.3, 9.4), but had no luck.

Thanks in advance
Timo

P.S.: In the sample program, use the arrow keys to rotate the mesh and
the C key to toggle backface culling.
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
0
Timo
4/15/2009 4:30:54 PM
comp.graphics.api.opengl 7063 articles. 24 followers. Post Follow

7 Replies
182 Views

Similar Articles

[PageSpeed] 41
For completeness, here's a screenshot from a NVIDIA card:
http://www.timosoft-software.de/stuff/mapping.jpg

Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
0
Timo
4/15/2009 5:15:51 PM
Timo Kunze wrote:

> [snip]

For me this looks like a culling problem. Do you use quads or
triangles as to-be-distorted mesh? If it's quads, try changing
into triangles by splitting the quads like

+---------+
|\       /|
| \     / |
|  \   /  |
|   \ /   |
|    +    |
|   / \   |
|  /   \  |
| /     \ |
|/       \|
+---------+

This should rule out any problems that may be caused by the quads
becoming concave, messing up the face direction or similiar.
Also it looks a lot better when used for a heightmap.


Wolfgang

0
Wolfgang
4/15/2009 8:13:04 PM
Hi,

I already use triangles.

Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
0
Timo
4/15/2009 8:44:44 PM
Timo Kunze wrote:

> Hi,
> 
> I already use triangles.

Ok, was just a thought.

But still it looks like if something is messing with the face
culling. So next question: Is face culling enabled? If so, try
what happens if you swich the culling mode from
glCullFace(GL_BACK) to glCullFace(GL_FRONT). If the missing
facets appear, then investigate further in that direction.


Wolfgang

0
Wolfgang
4/16/2009 10:13:03 AM
Wolfgang Draxinger schrieb:
> But still it looks like if something is messing with the face
> culling. So next question: Is face culling enabled? If so, try
> what happens if you swich the culling mode from
> glCullFace(GL_BACK) to glCullFace(GL_FRONT). If the missing
> facets appear, then investigate further in that direction.

I call glDisable(GL_CULL_FACE), so culling shouldn't be the problem.

Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
0
Timo
4/16/2009 2:17:47 PM
Got it working.
ATI cards have problems to chose the mipmap level when accessing
textures from vertex shaders. So you must use texture2DLod instead of
texture2D.

Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
0
Timo
4/17/2009 7:04:18 PM
Timo Kunze schrieb:
> ATI cards have problems to chose the mipmap level when accessing
> textures from vertex shaders. So you must use texture2DLod instead of
> texture2D.
....or don't mipmap the displacement map.

Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
0
Timo
4/17/2009 7:45:29 PM
Reply:
Similar Artilces:

decompose displacements
Hi, I have an object and its rigid-body displacement field. How do I decompose the displacements into a translational vector plus a pure rotation? Suppose I set the rotational origin at the centroid of the object. Thanks a lot. ...

Looking for conversion help
Hello, Please excuse this if this is the wrong forum. We develop software for the PICK market and use Telnet to connect our PixiEware software to PICK database systems. One of our products (PixieLink�) is a terminal emulator that understands DHTML as well as the VT100 protocol. It's key purpose is to allow the building of GRAPHICAL user interfaces (GUI) for previously green-screen applications. Our GUI is generated by DHTML and we provide client-side scripts that allow field-by-field, interactive editing and server response to each data entry action, just like traditional ...

[troll] Fine, so what is a "complete" RTOS?
I pontificated by saying that a complete RTOS should have both binary and counting semaphores, and someone called me on it by asking just what a "complete" RTOS is. I realized that my definition of a "complete" RTOS is pretty fuzzy -- mostly a mismash of every feature that I've ever wanted to use in an RTOS, with none of the features that I didn't want to use. This is ironic, because I also made a snide comment about RTOS vendors being self-centered. I know what the minimum set of features I want in an RTOS -- basically a prioritizing scheduler ...

Looking for Magic Window //e
If anyone has any information on where I can obtain or buy a copy of Magic Window //e, please let me know! It's my favorite Apple word processor, but my original disk died many years ago, and I never could make a backup copy because it was copy protected. Thanks! On Mar 9, 2:13=A0pm, robert.pap...@gmail.com wrote: > If anyone has any information on where I can obtain or buy a copy of > Magic Window //e, please let me know! =A0It's my favorite Apple word > processor, but my original disk died many years ago, and I never could > make a backup copy because it was copy prote...

Infineon execs fined and jailed for price fixing
LOL - I sure you guys will try to continue to deny it just like good old Sherry, the ex-Infineon employee who is now an "independent" analyst. http://www.forbes.com/enterprisetech/2004/12/02/cx_ah_1202infx.html Legal Infineon Execs Plead Guilty Arik Hesseldahl, 12.02.04, 6:30 PM ET NEW YORK - With four of its executives pleading guilty to price-fixing charges today, Infineon will have a hard time arguing that it didn't fix prices in its ongoing litigation with Rambus. The two companies have been fighting a protracted legal war over royalties and patents for four ...

Table look up inside a command?
I've tried the FAQ and CTAN archive, and I don't think this is answered there. How do I implement a simple table look-up? So that: \Lookup{NN} looks-up up a table indexed by NN and returns the string(s) found there. In church I produce the data-projector slides for each week's service; I want to be able to produce the slide for the songs - which comprise the song number and the first line - without having to cut and paste the whole first line every time... So: \Praise{540} rather than: \Praise{Revive your church, O Lord}{540} (where "Revive your church, O Lord"...

Still looking for Xenocopy (but only for academic purposes)
Im am still looking for Xenocopy - at least just for Screenshots of the disk format selection menu. I do not want to buy this very old program, but also I do not want to use this program for other reasons but academic purposes (documentation about the different disk copy programs in the past). It's really bad there is no possibility to take a look on it. If anybody has an other idea, do not hesitate to send me an email, thx in advance. Peter On 3/27/10 5:09 AM, Peter Dassow wrote: > Im am still looking for Xenocopy - at least just for Screenshots of the > disk format selectio...

OT: looking for best solutions for tracking projects and skills
I realize this is off-topic, but I'm not sure what forum is best for asking about this. I figure that at least a few of you are involved in civic hacking groups. I recently joined a group that does civic hacking. (Adopt-A-Hydrant is an example of civic hacking.) We need a solution for tracking projects and the skills needed for the projects (such as Ruby on Rails, Python, Drupal, Javascript, etc.). I'd like to hear from those of you in similar groups that have a great system for tracking projects. Is there an in-house solution you use, or is there something else available? ...

perspective projection matrix and planes
Hi, Apparently, you can transform the frustum planes from eye space to clip space by transforming the planes by the inverse-transpose of the perspective projection matrix. I carried out the matrix multiplications to verify this. I understand the proof of the plane transformation. (The proof I read was actually for rotations and translations of planes. So that is another thing that bothers me since the perspective matrix does things other than rotations and translations, like when it copies z to w.) I guess what bothers me is that the perspective transformation matrix is a little wa...

Looking for developers using PowerBuilder
I work for Macromedia and we are looking to form advisory groups to better understand the needs of developers and inform future product development. Those participating will have direct contact with us and other advisory board members and be provided with free Macromedia software. If you are interested in participating, please complete an application found at: http://www.surveymonkey.com/s.asp?u=49439324658. We are looking for developers that have never used Macromedia products and those that have, and developers from a wide variety of backgrounds and disciplines. If you are susp...

Plot a plane #3
Hi, I have three point po,p1 and p2. I want to plot a plane which goes through these point and also I want to specify the range of the plane. I mean I want to specify that the plane in x coordination goes from 0 to 100 and in y coordination goes from 200 to 300. Thank you ...

look for Rubricacn ttf font
Any one know where I can download rubricacn font i think the file's name is a_rubricacn.ttf Thanks rmartin ...

Laying out a new house
Looking at 80 lights/outlets being controlled, including a large detached garage. Looking for lighting control preferably with an integrated controller - UPB - Supported by Elk and HAI - Insteon - Single vendor, partially supported by Elk (limited grouping), not HAI - Zwave - Integrated with Elk, not HAI. No status feed back Also looking at installing a Russound, which is HAI supported as well. I've read the Insteon comparison, done by Insteon, with a skeptical view. Anyone had any real world experience with this size system and layout? Thanks I have about 50 Insteon swi...

looking for a job
hi i am a web developer from auckland looking for work. my skills are website design using photoshop, handcoded xhtml and css for cross browser compatibility, flash and a bit of joomla and wordpress. apart from applying through job sites can anyone let me know if there is a company that is looking for a web designer or developer for a part time, contract or full time job. thanks. ...

Displaced errorbars on log-log scale with cgPlot
Hello, I was using cgPlot to make the line plot on a log-log scale. I have include= d the y-axis errors around each data point. I have followed the Coyote Grap= hics Gallery - 'Error bar plot'. In my plot, I found that for some points t= he error bars are displaced and above the data point. I guess this is a bug= in log-log scaling of error bars!!!=20 Thanks in advance, Madhavan Madhavan Bomidi writes: > I was using cgPlot to make the line plot on a log-log scale. I have included the y-axis errors around each data point. I have followed the Coyote Graphics Gallery ...

Arbitrary plane from DICOM data
Hello, I've got DICOM files containing 3D dose data in x,y,z coordinates. I would like to extract dose planes at arbitrary angles. I don't really have any ideas how to do this. Would it involve using meshgrid and interp3? I would be grateful for any advice. Thanks! Just remember that I also wanted to say that I want the actual dose values on the plane of interest and not just an image of it, so "slice" command not useful? On Thursday, April 10, 2014 11:19:46 PM UTC+1, Jobo Baggins wrote: > Hello, > > > > I've got DICOM files containing 3D...

[News] Linux Foundation Doing Fine, Not Interested in Advertising (Brainwash)
Return From The Mountain ,----[ Quote ] | "It's not our job to advertise Linux." | | Yeah? Well maybe it's not and maybe that's the problem. It doesn't seem to be | anyone's "job" to advertise Linux. Sure you use it and most assuredly you | dump buckets of money into development and research, but in the final | analysis, companies like IBM and HP don't see any significant financial gain | from the desktop...it's a tool for them to achieve the profit they make from | the server side. | | Big Iron. | | Big Money. | | Big Budgets. `--...

plane in plot3
All, I have created a 3d plot using the plot3 function. In a normal plot I can create a line with a given length and height. line([1 4],[2 2]) %is a line line([1 4,[2 5]) %looks like a box so far nothing that a beginner like myself can't figure out. But now I want to create a plane in the plot3. I tried line([4 5],[1 50],[18 18]) it creates a line from 4 to 50 on the y with a height of 18. I think I'm probably using the wrong function could you please help me find the correct one? chmical "chmical" <parkertk.removee@corning.com.end> wrote in message news:ef4226...

Looking for advice on code generation project
I am in my Seventh sem. of B.S. degree in comp. science degree programme. I am looking for a system programming project on Linux platform (C language prefered). I was looking around when I landed up at this site link: http://pdos.lcs.mit.edu/pubs.html#Dynamic+Code+Generation I took a course in Compiler design and have done C programming thoroughly. I have 10 months duration to complete the project. I want to know whether : 1.) I would be able to make the "dynamic code generation" compiler on my own. 2.) What would be required to learn to make this project 3.) I have x86 architec...

Re: 497 million euro fine for Microsoft
On Sun, 26 Dec 2004 08:56:17 +0000 (UTC), Phillip Helbig---remove CLOTHES to reply <helbig@astro.multiclothesvax.de> wrote: > In article <1104042547.690118.274880@f14g2000cwb.googlegroups.com>, > "AEF" <spamsink2001@yahoo.com> writes: > > > Then what *should* the courts do in your opinion? Nothing? Demand that > > Microsoft come up with another OS to compete with itself? Apologies if > > I'm missing something obvious. > > They should carry out measures to do away with any unfair advantages of > the operating system itself. ...

Looking for a partime/weekend Java GUI designer in London or home counties
Hi I'm developing a J2EE app and need to have the front end developed. I am looking for someone with extensive Java GUI design experience, with experience of PLF/Skins, toolbars (floating or otherwise), pop-up menus, graphics (drag and drop would be nice but not necessary). It would help if you also had a good eye for design and detail - as aesthetics (as well as functionality and robustness) are very important. Please respond to me at j2ee_developer100_REMOVE_FOOT_FROM_MOUTH_TO_REPLY_AT_HOTMAIL>COM for further details Cheers ...

[News] A Look at Nexenta's Latest (OpenSolaris)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nexenta = flying a F29 with a wii remote and other highlights of the last few days ,----[ Quote ] | And, yes, lots of work. For example several | new systems installed for our automated test | and certification solution, approximately 60 | customers and countless prospects have had | their questions answered, and significant | recruiting work on our immediate priorities | including inside sales, sales engineering, | software develand support. `---- http://www.nexenta.com/corp/blog/2010/02/06/nexenta-flying-a-f29-with-a-wii-remote-and-oth...

[News] HD-DVD DRM Cracked
Volume ID found!! (now Blu-Ray and HD DVD) (+instructions) ,----[ Quote ] | You're missing the point. With the media key we can decrypt | all disks released so far. `---- Server is down http://forum.doom9.org/showthread.php?t=121866&page=6 http://72.14.203.104/search?q=cache:http://forum.doom9.org/showthread.php?t=121866&page=6&safe=active http://tinyurl.com/353fyd Related: Big labels are f*cked, and DRM is dead - Peter Jenner ,----[ Quote ] | Few people know the music industry better than Peter Jenner. Pink | Floyd's first manager, who subsequently managed Syd Barre...

Hey, look!
HOW TO MAKE THOUSANDS WITH JUST 6 DOLLARS! I found this on a bulletin board and decided to try this out, i was in need of some money. When i first saw the message i thought 'Yeah right, this is just some scam!' But when you read it you will see that you dont give any money to some company, but just one dollar to six other people that done this neat trick! This really does work, and i will also tell you how this works! First get 6 one dollars notes or coins and get 6 envelopes and put one dollar in each envelope and cover the dollar in a white piece of paper (so people cant see the dol...

Looking for a better recommendation for people who want to make use of comp.lang.tcl
In the past, recommending people use Dejanews and then Google news provided an ability to read the group to the individual developer or user who did not have the financial resources to pay for access to a usenet site, nor enough computing resources to host a usenet feed of their own. However, in the past few weeks, Google has begun a fundamental change in the way the group reading software works. In the old interface, they have removed the ability to display specific "favorite threads" and to determine when they were updated. They also removed the advanced searching functionality, m...