Skip to main content

[JAVA3D-INTEREST] [JAVA3D] red colors on ATI Radeon, but not on NVidia

5 replies [Last post]
Anonymous

When I run my Java3D app on an nvidia-based system, everything works
fine - see attached "ok-globe.jpg" for example. When I run the exact
same app on a radeon-based system, all the colors are switched to
red-only - for example see "red-globe.jpg" attached. I've tried this on
several different machines with same results.

Has anybody else come across this behavior before?
-- Russell

Here is (pretty much) what I'm doing in code to create the imagery:

int width, height; // are known
BufferedImage image = new
BufferedImage(width,height,BufferedImage.TYPE_4BYTE_ABGR);
DataBufferByte bbuffer =
(DataBufferByte)image.getRaster().getDataBuffer();
byte[] data = bbuffer.getData();
int outputCounter = 0;
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
byte alpha, blue, green, red; // are calculated
at this point
data[outputCounter++] = alpha;
data[outputCounter++] = blue;
data[outputCounter++] = green;
data[outputCounter++] = red;
}
}

and here to create the texture:

Appearance appearance = new Appearance();
appearance.setCapability(Appearance.ALLOW_TEXTURE_READ);
appearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
ImageComponent2D imageComponent = new ImageComponent2D(
ImageComponent.FORMAT_RGBA8, image, true, true);
Texture2D texture = new Texture2D(Texture2D.BASE_LEVEL,
Texture.RGBA, width, height);
texture.setMinFilter(Texture2D.BASE_LEVEL_LINEAR);
texture.setMagFilter(Texture2D.BASE_LEVEL_LINEAR);
texture.setBoundaryModeS(Texture.CLAMP_TO_EDGE);
texture.setBoundaryModeT(Texture.CLAMP_TO_EDGE);
texture.setImage(0, imageComponent);
appearance.setTexture(texture);
setAppearance(appearance);

[red-globe.jpg]
[ok-globe.jpg]
---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Russell East

We've just upgraded the WinXP driver for one of the Dell/Radeon laptops
and tried again. This time, the textures do not appear at all.

It's almost like, with the previous driver, all color values were loaded
into the Red only as a "grey-scale". And with the new driver, perhaps,
all color values are loaded into the Alpha only. Does this make any
kind of sense?

-- Russell

____________________________________________________________

Russell East wrote:

> When I run my Java3D app on an nvidia-based system, everything works
> fine - see attached "ok-globe.jpg" for example. When I run the exact
> same app on a radeon-based system, all the colors are switched to
> red-only - for example see "red-globe.jpg" attached. I've tried this
> on several different machines with same results.
>
> Has anybody else come across this behavior before?
> -- Russell
>
> Here is (pretty much) what I'm doing in code to create the imagery:
>
> int width, height; // are known
> BufferedImage image = new
> BufferedImage(width,height,BufferedImage.TYPE_4BYTE_ABGR);
> DataBufferByte bbuffer =
> (DataBufferByte)image.getRaster().getDataBuffer();
> byte[] data = bbuffer.getData();
> int outputCounter = 0;
> for (int row = 0; row < height; row++) {
> for (int col = 0; col < width; col++) {
> byte alpha, blue, green, red; // are calculated
> at this point
> data[outputCounter++] = alpha;
> data[outputCounter++] = blue;
> data[outputCounter++] = green;
> data[outputCounter++] = red;
> }
> }
>
> and here to create the texture:
>
> Appearance appearance = new Appearance();
> appearance.setCapability(Appearance.ALLOW_TEXTURE_READ);
> appearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
> ImageComponent2D imageComponent = new ImageComponent2D(
> ImageComponent.FORMAT_RGBA8, image, true, true);
> Texture2D texture = new Texture2D(Texture2D.BASE_LEVEL,
> Texture.RGBA, width, height);
> texture.setMinFilter(Texture2D.BASE_LEVEL_LINEAR);
> texture.setMagFilter(Texture2D.BASE_LEVEL_LINEAR);
> texture.setBoundaryModeS(Texture.CLAMP_TO_EDGE);
> texture.setBoundaryModeT(Texture.CLAMP_TO_EDGE);
> texture.setImage(0, imageComponent);
> appearance.setTexture(texture);
> setAppearance(appearance);

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Matthew Hilliard

Take everything I say here with a grain of salt.
I've seen non-Dell drivers have problems on Dell machines, due to a large
number of proprietary tweaks. Especially on their graphics cards.
(Its not just Dell, I've seen HP/Compaq and IBM do it too).
Did you upgrade to a Dell driver or an ATI one? Was the old one a Dell
driver or ATI?
Have you tried the other's recent offerings? (I'm not suggesting you
do--note that all radeon cards have had trouble with certain recent ATI
drivers and there is a long thread about it earlier on this
forum. Remember too, that ATI drivers MAY NOT purge themselves completely
when you uninstall them, and once you start having troubles with their
drivers, its hard to stop.)

From the image you sent, with the first driver, it wasn't all red, but the
red and blue were inverted. This was probably a byte-order or endianness
issue, and there's a really good chance the drivers are at fault here
(especially if the same code runs properly on other hardware). If you can
install the old drivers you can run an experiment to swap the red and blue
to see if I'm guessing right.
It seems to me if the ONLY thing changed was drivers and everything is
coming out black, but wasn't before--the drivers are at fault again. You
might be right about alpha, again. swap a few colours and see if anything
changes.

If Dell or ATI can offer you support, I say go for it, but my firsthand
experiences with both companies make me think you might be S.O.L. :(

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Russell East

Matthew Hilliard wrote:

> Take everything I say here with a grain of salt.

:-)

> Did you upgrade to a Dell driver or an ATI one? Was the old one a
> Dell driver or ATI?
> Have you tried the other's recent offerings?....

We've now tried the following:

Linux and Windows with NVidia - works fine
Sun sparc Ultra60 - works fine
MacBook with ATI Rage - works fine
Windows with ATI Radeon - fails

We tried to upgrade one of the Dell/Radeon laptops with the latest
driver from ATI, but the install failed to proceed. Instead we got the
latest driver from Dell, which installed fine, but now, there is no
Java3D canvas displayed at all.

>
> From the image you sent, with the first driver, it wasn't all red, but
> the red and blue were inverted.

At first sight maybe - but there is no other color shown - only red. To
my mind, it is a grey-scale shown on the red video gun only.

> This was probably a byte-order or endianness issue, and there's a
> really good chance the drivers are at fault here (especially if the
> same code runs properly on other hardware). If you can install the
> old drivers you can run an experiment to swap the red and blue to see
> if I'm guessing right.

Can't really change the drivers back - I've been making a pest of myself
with a whole lotta other people's computers, and I think I've done
enough mischief. ;-)

> It seems to me if the ONLY thing changed was drivers and everything is
> coming out black, but wasn't before--the drivers are at fault again.
> You might be right about alpha, again. swap a few colours and see if
> anything changes.

My code used another kind of BufferedImage before, and it worked ok, but
slowly on the Radeons. What I'd like to be able to do is use the new
code for non-Radeon, and old code for Radeon. Is it possible to detect
the graphics driver from Java3D?

-- Russell

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Matthew Hilliard

>We tried to upgrade one of the Dell/Radeon laptops with the latest
>driver from ATI, but the install failed to proceed. Instead we got the
>latest driver from Dell, which installed fine, but now, there is no
>Java3D canvas displayed at all.

Ick. So Dell has you over a barrel here :(

At first sight maybe - but there is no other color shown - only red. To
>my mind, it is a grey-scale shown on the red video gun only.

There's a suspicious amount of white, (or pinky "near white") which makes
me think the other guns are firing too.

>Can't really change the drivers back - I've been making a pest of myself
>with a whole lotta other people's computers, and I think I've done
>enough mischief. ;-)

Heh. Its one of those "might help" things that just doesn't. Been there
done that.

>My code used another kind of BufferedImage before, and it worked ok, but
>slowly on the Radeons. What I'd like to be able to do is use the new
>code for non-Radeon, and old code for Radeon. Is it possible to detect
>the graphics driver from Java3D?

I've discovered there's all kinds of counterintuitive madness inherent to
various underlying BufferedImage implementations. You get different datum
from Toolkit and ImageIO, and it wouldn't surprise me if JAI does things a
touch differently either. Have you had any luck using images with palettes
(GIF for example) or one of the other loading techniques?

WRT driver ID, I don't think so. Its possible to ask the underlying OpenGL
calling glGetString() who the vendor is plus what GL driver and hardware it
thinks you're running on, but I haven't seen that exposed from j3d anywhere.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

Russell East

Well, some good news.

On one of our Radeon-based laptops - a Dell D600 - we downgraded the
Dell Radeon driver from the current one (dated 12/1/2004) to the
previous one (dated 7/22/2004) and our application worked fine. It's
curious that the December driver is marked for both Win2000 and XP,
whereas the July driver is only for XP.

Anyway, that issue is behind us. On to the next....

-- Russell

Matthew Hilliard wrote:

>
> >We tried to upgrade one of the Dell/Radeon laptops with the latest
> >driver from ATI, but the install failed to proceed. Instead we got the
> >latest driver from Dell, which installed fine, but now, there is no
> >Java3D canvas displayed at all.
>
> Ick. So Dell has you over a barrel here :(
>
> At first sight maybe - but there is no other color shown - only red. To
> >my mind, it is a grey-scale shown on the red video gun only.
>
> There's a suspicious amount of white, (or pinky "near white") which makes
> me think the other guns are firing too.
>
> >Can't really change the drivers back - I've been making a pest of myself
> >with a whole lotta other people's computers, and I think I've done
> >enough mischief. ;-)
>
> Heh. Its one of those "might help" things that just doesn't. Been there
> done that.
>
> >My code used another kind of BufferedImage before, and it worked ok, but
> >slowly on the Radeons. What I'd like to be able to do is use the new
> >code for non-Radeon, and old code for Radeon. Is it possible to detect
> >the graphics driver from Java3D?
>
> I've discovered there's all kinds of counterintuitive madness inherent to
> various underlying BufferedImage implementations. You get different
> datum
> from Toolkit and ImageIO, and it wouldn't surprise me if JAI does
> things a
> touch differently either. Have you had any luck using images with
> palettes
> (GIF for example) or one of the other loading techniques?
>
> WRT driver ID, I don't think so. Its possible to ask the underlying
> OpenGL
> calling glGetString() who the vendor is plus what GL driver and
> hardware it
> thinks you're running on, but I haven't seen that exposed from j3d
> anywhere.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
> For additional commands, e-mail: interest-help@java3d.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net