Javier Abadia (jabadia++at++sfe.indra.es)
Thu, 26 Aug 1999 08:09:09 +0200
Well, two days ago, I posted a question about dynamic
texturing.
I think it's not a very difficult question so I am
a bit disappointed because I really need to know what
I asked, and I don't know anywhere else to find out.
Could someone please point at some documentation that
gives a clear image of pfTexture API, especially about
setLoadImage(), setFormat, etc? (I have studied
every word in pfTexture man page, but I'm stuck)
I'd like to add another question to that original posting:
3. How does filtering (mipmaps and so) become affected
by changing texture dynamically? Do mipmaps get
generated each time I change pixels on the texture?
I'd appreciate any answer. Really.
Thank you.
Original posting:
> Hello all:
>
> I'm trying to dynamically modify textures. I follow these steps:
>
> pfTexture *tex = new pfTexture;
>
> tex->loadFile("myFile.rgb");
> tex->setLoadMode(PFTEX_LOAD_SOURCE, PFTEX_SOURCE_IMAGE);
>
>
> Then, each frame I call this function (from APP):
>
> void modify_texture(void)
> {
> static unsigned int *m_bits;
> static int m_planes, m_width, m_height;
>
> if(first_time)
> {
> tex->getImage(&m_bits, &m_planes, &m_width, &m_height, NULL)
> }
>
>
> ...
> do some modification on m_bits
> ...
>
> tex->setLoadImage(m_bits);
> }
>
> I have two questions:
>
> 1. Does any of these pfFunctions need to be called in any special
> process? I'm calling them in APP and seems to work fine.
>
> 2. In order to achive good performance, I understand that I should
> minimize texture reformatting. Moreover, I would like to do
> modifications
> using 16 bit texels with 4 bits per component, which is the internal
> texture format as well, isn't it?
>
> How do I get pfTexture::getImage() return m_bits in that format?
> I have tried using pfTexture::setFormat() but I think I don't understand
> it very well. When should I call setFormat(), and what tokens should
> I pass?
>
> pfThank you!
>
>
-- Javier Abadia Miranda / Ingeniero en Informatica MADRID (SPAIN) / Especialista en Informatica Grafica
This archive was generated by hypermail 2.0b2 on Wed Aug 25 1999 - 23:15:01 PDT