Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"You are WRONG, you ol' brass-breasted fascist poop!" -- Bloom County


devel / comp.os.ms-windows.programmer.win32 / OpenGL glTexImage2D sometimes creates an opaque white texture ?

SubjectAuthor
* OpenGL glTexImage2D sometimes creates an opaque white texture ?R.Wieser
`* Re: OpenGL glTexImage2D sometimes creates an opaque white texture ? Update.R.Wieser
 `- Re: OpenGL glTexImage2D sometimes creates an opaque white texture ? Solved.R.Wieser

1
OpenGL glTexImage2D sometimes creates an opaque white texture ?

<t12dmi$tk2$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=383&group=comp.os.ms-windows.programmer.win32#383

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: OpenGL glTexImage2D sometimes creates an opaque white texture ?
Date: Fri, 18 Mar 2022 17:57:39 +0100
Organization: Aioe.org NNTP Server
Lines: 31
Message-ID: <t12dmi$tk2$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="30338"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
 by: R.Wieser - Fri, 18 Mar 2022 16:57 UTC

Hello all,

I've been using OpenGL to show some scenery, and am adding textures (while
loading the models) using the glTexImage2D call (which takes raw pixels).

The problem is that just a few textures of the 80 I add turn out to be a
fully opaque white*. However, when I pre-load such a texture it turns out
fine.

* in the loaded model as well as in a debugging model in which I display all
loaded textures as squares in a grid (read: its not a problem just of the
model).

an glGetError call just after the glTexImage2D one always shows Zero (no
error)

And oh yeah, the effect seems to be static. I've ran the program a number
of times and even on different days (rebooting the 'puter) in between, but
its always the same textures that go wrong.

I've also tried to change the raw pixel data for all textures to fully
transparent just before calling glTexImage2D, but the opaque white textures
stayed - which seems to indicate that its really related to the glTexImage2D
call.

The question is, what can be causing it ?

Regards,
Rudy Wieser

Re: OpenGL glTexImage2D sometimes creates an opaque white texture ? Update.

<t16vnf$lt9$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=384&group=comp.os.ms-windows.programmer.win32#384

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: OpenGL glTexImage2D sometimes creates an opaque white texture ? Update.
Date: Sun, 20 Mar 2022 11:29:49 +0100
Organization: Aioe.org NNTP Server
Lines: 26
Message-ID: <t16vnf$lt9$1@gioia.aioe.org>
References: <t12dmi$tk2$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="22441"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Sun, 20 Mar 2022 10:29 UTC

> The problem is that just a few textures of the 80 I add turn out to be
> a fully opaque white*. However, when I pre-load such a texture it turns
> out fine.

Trying to isolate what circumstances cause it I found that putting just the
glTexImage2D inside a glNewlist, glEndlist pair causes the effect to happen.

Which is rather odd as I load all other, looking OK, images the exact same
way.

Also, glGetError keeps returning an OK status before and after calling each
of the above three functions.

I also checked if its actually the glTexImage2D function, by directly after
it using glGetTexImage. On most textures I get back what I offered to
glTexImage2D, but on the problematic ones the targtet "pixel" buffer doesn't
get touched - but still the glGetError call after the glGetTexImage one
returns an OK status ...

I have /no/ idea what is going on here. Help ?

Regards,
Rudy Wieser

Re: OpenGL glTexImage2D sometimes creates an opaque white texture ? Solved.

<t19mqm$1srv$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=385&group=comp.os.ms-windows.programmer.win32#385

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: OpenGL glTexImage2D sometimes creates an opaque white texture ? Solved.
Date: Mon, 21 Mar 2022 12:16:26 +0100
Organization: Aioe.org NNTP Server
Lines: 20
Message-ID: <t19mqm$1srv$1@gioia.aioe.org>
References: <t12dmi$tk2$1@gioia.aioe.org> <t16vnf$lt9$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="62335"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MSMail-Priority: Normal
 by: R.Wieser - Mon, 21 Mar 2022 11:16 UTC

> I have /no/ idea what is going on here. Help ?

After a few days of testing, trying to make sense of seemingly inconsistent
results, I found in which circumstances it happened and from there the why
of it. A quick succesfull "that means if I do {this} (a hack) my problem
should disappear" test seemed to confirm it. With that in hand looking at
the involved functions gave me lead on what to change to fix it.

Bottom line : creating textures within a displaylist (glNewList) and sharing
those textures with other displaylists comes with a few gotyas - none of
them described in the MSDN pages to the involved functions.

And ofcourse, looking back the problem and its solution do seem to be quite
obvious.

Regards,
Rudy Wieser

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor