JOGL Texture Demo: one more time

I’m looking at this Texture Demo again and it looks like this is the only realistic way to do this. Although TextureRenderer looks promising, it’s not going to render the Streets of Stalingrad map as it’s way too big for a single texture (at least on my laptop – and I’d be surprised if the maximum texture size is that big on ANY video card). The way I’m doing this now, the only limit is the amount of memory on your video card (not the same thing as maximum texture size).

So here is the demo (large due to the map):

myweb.dal.ca/mkiefte/TextureDemo081227.zip

Linux: run.sh
64-bit Linux: run64.sh
Windows: run.bat
Win64: run64.bat
Mac: runmac.sh
PPC: runppc.sh
Solaris: do it yourself

Left button moves the map around. Middle button zooms, right button rotates. I don’t have a scroll, so that probably doesn’t work.

The last time I checked, this worked for everyone, but I’m going to be tweaking it some more. There are some irregularities, but only I know what they are – I’ll be interested if you can spot them.

  • M.

Ran it on my laptop (Vista32). Very smooth and quick. Only thing I noticed was anti-aliasing is not on/enabled?, jagged edges were evident on rotation along map edge. Video card is set to application controlled currently

Tim

It’s antialiased inside the texture, but the edges aren’t?

This is what I have on mine (I don’t have a hardware accelerated video card – just a mobile Intel):

http://myweb.dal.ca/mkiefte/Screenshot-TextureDemo.png

I can solve the edges part by simply adding a black border around the map.

  • M.

2008/12/28 Tim M <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Post generated using Mail2Forum (mail2forum.com)

Thus spake “mkiefte”:

What would the results be like if we split the map into tiles and used one
texture for each tile? Would we end up with alignment problems at the seams?

Reminder: Please make archives which extract themselves to a single,
new directory. This one splattered itself all over the directory where
I unzipped it.

When I press any button over the map, it goes grey until there’s some mouse
movement. If I’m dragging, this exhibits itself as a brief grey flicker; I
just left click on the map, it stays grey until I start a drag.

Also, there’s some flickering when I resize the window, as well as when I
do things like windowshade or move it.

It works very well for me otherwise, and I have pretty anemic video hardware
on my laptop.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Put a new version up here:

http://myweb.dal.ca/mkiefte/TextureDemo081228.zip

This might solve Tim’s antialiasing problem.

Tim, you only need to download and substitute this file:

http://myweb.dal.ca/mkiefte/TextureDemo.class

  • M.

2008/12/28 Michael Kiefte <mkiefte@dal.ca (mkiefte@dal.ca)>

Post generated using Mail2Forum (mail2forum.com)

That’s what I’m doing now, and yes, there are alignment problems. However, see if you can spot them.

There is a trick with tiled textures where sizes can be 2^N+2 instead of 2^N that solves the alignment problems. However, this slowed some computers to a crawl. The trick I’m using is to blend the two edges together.

Point noted.

Had you ever seen that before?

That’s a known issue. I know how to solve it, however.

The grey flicker sounds like a very serious problem. Are you using Mesa or is this video hardware?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

No, I can’t. Where should I look?

Any idea why?

This also happened with an older version of the demo.

It also doesn’t composit properly with other windows. E.g., if I have another
window overlapping it, the drop shadow from the overlapping window is drawn
over a grey background rather than the actual contents of the demo window.

I’m using Mesa, but it’s still hardware rendering. What I have is an Intel
965GM, possibly the same thing you have.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Here’s a screenshot of what’s wrong with window compositing.

You can see the grey area just outside the terminal window, above the demo.
The problem seems to be with JOGL or the way you’re using it, as the drop
shadow is rendered properly over the window border, toolbar, and title bar.

Thus spake “Michael Kiefte”:

If I uncomment canvas.display() at the end of mousePressed(), I only get
flicker on a click instead of the whole window going grey. That’s an
improvement, but it shouldn’t repaint the window on a click at all.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

2008/12/28 uckelman <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

I don’t really know how that works. I’m not really aware of anything in OpenGL that tells desktops to do the right thing. This is more of a window manager issue.

What happens if you turn off all nifty graphical features of your window manager? Do you still get the grey flickering?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Look at hex 0901. The numbers are blurry, but that’s nothing to do with the demo (it’s a scanned map).

GPUs like powers of 2. The extra +2 was a kludge introduced in later versions of OpenGL but older video cards don’t like it. I have yet to see one where it works as fast.

That sounds familiar. The video drivers for Linux aren’t great though. I use a tablet, so I had to turn all acceleration off, but the demo still works well. I don’t have any flashy effects on, however.

  • M.

Post generated using Mail2Forum (mail2forum.com)

I’ll check it out. You’re probably right.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

It’s an interaction issue between OpenGL and Compiz. That’s aggravating,
as I’d been wanting to use Compiz for something like three years before
I was finally able to with Fedora 10 for the past month. We have to find
a workaround for this which doesn’t involve shutting off Compiz, as it’s
becomming very popular these days.

No, it goes away.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

Is the black line which runs through the barrel of the PPSh-41 in the photo in
the upper left and most of the way across the map image a seam?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Believe it or not, that’s in the original image.

Zoom in very close on hex 0901. You’ll see a horizontal discontinuity towards the top of the hex. That’s a texture edge. It’s almost impossible to notice at 100%, but once you know where to look, you can see it.

  • M.

Post generated using Mail2Forum (mail2forum.com)

I’ll poke around to see what options I can turn on or off. I think I made some assumptions about what wasn’t going to happen to the canvas, but it’s been a while and the older I get, the less I retain.

At least we know what it is.

In the end, we’re going to have to add some obscure OpenGL options in the preferences. There’s just too much variation in hardware and desktop configuration. Defaults will have to be dumb.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

Ugh. Somebody should fix that.

I did notice that after you said to look at 0901. It’s not obvious at all
on a map like this.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

One of the options will be to use texture edges (the +2 in 2^N+2) which will completely eliminate that. However, I knew what to look for…

  • M.

Post generated using Mail2Forum (mail2forum.com)

Does it flicker when you release?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

No, it never flickers on release, only on press.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)