Panda 1.7.0 Manual "Dynamic Cube Maps" crashes pyt

Thanks David; I’ve now got the movie centred on the card and also on a cube in my test game. I tried adding “textures-power-2 none” in Config.prc file but it gave errors like:
:display:gsg:glgsg(error): GL texture creation failed for book-new : invalid value
for a number of textures.
I also tried adding
.setTexScale(, .getTexScale())
but it made no difference I could see.
I get a black band at the top of the movie texture – is that because it uses the full cube face width but not the full height, as the movie aspect ratio is different from the object face dimension ratio?
Is there a way to make the movie texture bigger than the cube face so that a part of the movie fills the whole face?
Brian

OK, it seems your graphics card requires true power-of-two textures, so the textures-power-2 trick won’t work for you.

What size is your video? The black band is probably due to the fact that the video has to be embedded within a power-of-two sized larger texture, which the setTexScale() trick is supposed to compensate for. Actually, perhaps in 1.7.2 the getTexScale() didn’t work reliably, and you had to use a different interface, like this:

w = float(tex.getVideoWidth()) / float(tex.getXSize())
h = float(tex.getVideoHeight()) / float(tex.getYSize())
obj.setTexScale(ts, (w, h))

David

Thanks David. I tried the float() code but it still makes no difference.
By the way, it’s only when I render the movie onto a cube in my test game that I see the black band; when I render the same movie onto a card in the Media-Player sample, the movie fills the whole window and continues to do so when I drag to re-proportion the window. I’m guessing cards are quite different?
My video’s set to 1024x768 if that’s what you mean by its size.
Brian

Maybe your cube model uses a different TextureStage, or something? There must be some reason that setting the texture scale doesn’t have a visible effect at all.

Right, 1024x768 is a power of 2 in x, but not in y, so the movie will be embedded in a 1024x1024 texture with a black band across the top. The setTexScale() call is supposed to scale the UV’s vertically to remove the black band. You could also do the same thing by creating the UV’s in the first place so that the top edge is at (0,0.75) to (1,0.75) (instead of (0,1) to (1,1)), because 0.75 = 768/1024.

David

OK, I’ve edited my cube.egg to :

Cube {
Cube {
0 {
1.000000 1.000000 -1.000000
{ 0 0.75 } #was 0.000000 1.000000
{ 1.0 1.0 1.0 1.0 }
}

It made no difference, but is that sufficient for the change you’re suggesting?
Brian

Yes, well, you have to change more than just the one vertex. But that change alone should certainly make at least one corner line up, and if it doesn’t, perhaps something is indeed wrong. Really, no difference at all?

David

OK, I’ve now set all the (0 1) and (1 1) (0 0.75) to (1 0.75) and the movie now fills the face of the object. Thanks
Brian