Render to texture compression?

I'm just curious. I'm using render to texture to render my planets and then plaster them onto quads. When I view the textured model normally it looks fine, but when I view the quad with the rendered version, there is banding in some gradiated areas as if the image has been compressed. Is it possible to turn this off if it is in fact causing what I'm seeing?

I see a bit of jaggies and maybe some banding, but nothing too horrible.  I assume your display setting is 32 bit?  :slight_smile:

Yes sir. Cross checked and double checked. 32. The banding is bad IMHO. Maybe it's not as noticable from that shot, but it's bad. Any other thoughts?

Well I'm having more compression blues. I'm starting to work on my HUD with help from the Wiki. I have the following code, but the 32 bit png is getting compressed. Why on Earth would that be?



TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();

ts.setEnabled(true);

Texture tex = TextureManager.loadTexture(IngameState.class

.getClassLoader().getResource(

"resources/texture/hud/main_rns.png"), Texture.MM_LINEAR,

Our PNG support is via javax.imageio.ImageIO.  It's possible that it has some kind of issue with 32 bit png files…  maybe?  Can you post a screen shot?

Will do. I also tried a tga and it had the same effect though.

You can see the effects of compression in the oceans on the planet and in the chatbox at the top of the screen.



What resolution are you setting the texture renderer to? i.e.



display.createTextureRenderer(…);



Have you tried increasing this resolution? (BTW, it can't be higher than the resolution of the window are garbage will be created currently. We need to take care of that issue.)



Not sure if that will help or not, but should be a quick check.

Well I did have it at 2048x2048. :lol:



I lowered it to 1024 and it still has the same problem. BTW, my display was set at 1248x1024 and I was rendering that texture at 2048 with no garbage or ill effects (other than the compression and banding) using a 6800GT.

Ok, I'm seeing some oddities as well. We will look into these issues soon (as soon as we get some of these memory fixes out of the way). Can you live with the banding for a bit longer?

Can you e-mail me your world texture? I'm going to put two spheres up one real the other RTT. I want to compare directly side by side, and I'd like to use the same texture you have. If possible, e-mail using profile e-mail.



Thanks.

Ok Slowdive, I've committed a new test jmetest.renderer.TestRTTSideBySide into CVS. Try this test. It renders a sphere twice left is actual geometry right is RTT. I used the basic Monkey head texture and notice no banding or any issues with the image. Can you try on your end and see if you notice any problems?

Hiya Mojo. I've tried your test with my texture and yes the problem shows in BOTH situations. Odd. I guess I just didn't notice it when I was rendering my planets normally. I've forwarded you a copy of the texture via email.



It's not super urgent to get this fixed. But it would be great if we got to the bottom of it at some point.



Thanks for the help!

At least then it would seem not to be a RTT issue.  Have you tried putting the texture on something else with a flat surface… say a box?  See if the banding is there.  Perhaps it is an exageration due to the curve of the sphere?

Ok, played with your texture some. I get the artifact you describe and show in your screenshot on BOTH the normal sphere and the RTT texture.







But I had to squint to see it and compare it to the original texture to make sure. And you are positive that it does not appear on your normal geometry?



I’m going to be focusing on TextureRenderer for a little bit (putting in fault checking and such, as there seems to be problems with texture sizes). But this banding issue is not one I am really having that bad. This is odd. I’ll be working it though, and hopefully we’ll get to the bottom of it. It’s probably a matter of settings and graphics card differences.



I’ll keep you updated.

Yeah, I see it pretty clearly in game. In the test I have to zoom up fairly close to see it though probably because it's most noticable when the texture is filling up most of the screen. And I don't know if this is related, but also in my cockpit graphic I have the banding. And that's just a png plastered on a quad. Any place there's a gradient it's pretty noticeable.

Ok, I'll keep hammering at this, cleaning up things along the way and hopefully finding out what is causing it for you.

Ok, I cleaned up the render to texture code to basically make it very cross-platform. You can put in settings for a high-end system and it will downgrade as needed if it's ran on a low end system.



That being said, I don't think this will help you SlowDive. Because you said you were now noticing problems on the non-RTT sphere, I think it might be more texture loading related. As Renanse mentioned, try loading your texture to a Quad or box, to see it without the curve of the sphere.

Yes, the cockpit, which is basically just a texture plastered on a quad is exhibiting the the same compressed banding. Let me ask you just to be sure, how would I definitively check to see if the game was actually switched into 32 bit mode? Just want to make sure I'm doing that correctly.

You could print out display.getBitDepth().



One thing I'd suggest is throwing together a quick Swing test, throwing your image up on a JPanel or JLabel or something and see if there is any banding.  We need to find out where the banding is taking place…  in the loading?  in the texture generation?  in the texture state params?  in the display params?  etc.