Search found 1125 matches

by robmar
Wed Aug 17, 2011 9:31 am
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

Re: ITexture unlock fails to upload modified bytes to GPU

Just read your other comment!

So is there a quickfix to have the pixel data updated on the unlock call for a texture created with AddRenderTargetTexture?
by robmar
Wed Aug 17, 2011 9:28 am
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

Re: ITexture unlock fails to upload modified bytes to GPU

I didn´t realize that I was doing something "interesting" as you put it. It was just that to be able to update textures with mixed content, i.e. background image (jpg png) and overlay live data text and icons on fairly complex screens, it seemed the right route. I suppose that I can also u...
by robmar
Wed Aug 17, 2011 12:22 am
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

Re: ITexture unlock fails to upload modified bytes to GPU

I seem to have a problem with using AddTexture in place of AddRenderTargetTexture, as any object with textures from Addtexture is now only working with direct byte updates, and all other drawing, using Draw2DImage, etc., or even setting the textures color using setRenderTarget( true,..., now fails t...
by robmar
Tue Aug 16, 2011 11:39 pm
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

Re: ITexture unlock fails to upload modified bytes to GPU

Firstly, thanks for your help with this. Irrlicht is an excellent (large) piece of coding, and seems really well structured, and makes getting into 3D much easier than all that jargon-packed Windows D3D stuff which I'm sure has put many people off 3D! I understand what rendertargets are for now, alt...
by robmar
Tue Aug 16, 2011 9:52 pm
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

Re: ITexture unlock fails to upload modified bytes to GPU

I'm using the d3d9 driver.
by robmar
Tue Aug 16, 2011 9:50 pm
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

Re: ITexture unlock fails to upload modified bytes to GPU

Okay, points noted. I thought that addrendertargettexture was the method to add textures to the general texture cache, which could then be mapped to any surface on multiple objects. I render to textures which are mapped to any object/s, is this not the correct method? I like the cache concept as thi...
by robmar
Tue Aug 16, 2011 7:31 pm
Forum: Beginners Help
Topic: ITexture unlock fails to upload modified bytes to GPU
Replies: 42
Views: 1224

ITexture unlock fails to upload modified bytes to GPU

With Irrlicht 1.7.2 on Windows XP SP3, it is imposible to modify a mapped texture's pixel data directly and have it reflected on screen.     ITexture *m_pITexture = m_pDriver->addRenderTargetTexture( core::dimension2d<u32>( 256, 256 ), "MyTexture", ECF_A8R8G8B8 );   m_material[i].setTextur...
by robmar
Tue Aug 16, 2011 3:47 pm
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

and last but not least... to conenct the material and its texture to the scenenode:- m_pAnimatedMeshSceneNode->getMaterial(0) = m_material ; Drawing to the texture assigned works perfectly, if I use Irrlicht's drawing function, I just can't update the texture's surface pixels directly.., making upda...
by robmar
Tue Aug 16, 2011 3:44 pm
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

Here's the code again:- ITexture *m_pITexture = m_pDriver->addRenderTargetTexture( core::dimension2d<u32>( 256, 256 ), "MyTexture", ECF_A8R8G8B8 ); m_material .setTexture( 0, m_pITexture ); // Map texture to mesh BYTE *pBits = m_pITexture->lock(); // Ptr to pixel memory void *pDst = memcpy...
by robmar
Tue Aug 16, 2011 3:39 pm
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

ITexture *m_pITexture = m_pDriver->addRenderTargetTexture( core::dimension2d<u32>( dx, dy ), (LPCTSTR)sz, ECF_A8R8G8B8 );
m_material.setTexture( 0, m_pITexture );
by robmar
Tue Aug 16, 2011 3:37 pm
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

Hello, I do!! Look at the code I posted, its is:- Buf->unlock(); // Should now update texture to GPU, but nothing happens!! // Buf is a ITexture * It does not work on Irrlicht 1.7.2 , byte modification of ITextures created with addRenderTargetTexture:- m_pDriver->addRenderTargetTexture( core::dimens...
by robmar
Tue Aug 16, 2011 9:50 am
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

I just triple-checked my code, and locking, updating bytes on the ITexture of a cube surface, using the ptr returned by lock, and then unlocking does NOT cause the texture to be reloaded to the GPU. Creating a texture with AddTexture, then performing the lock-update-byte-unlock on it, then using dra...
by robmar
Tue Aug 16, 2011 8:53 am
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

That is what I tried to do. It doesn't work! I posted the code above. Buf is the ptr to the ITexture created with AddRenderTexture. I Buf->lock() it, use the returned ptr to update the pixels, call Buf->unlock(), but the pixels never get updated. I checked the pixels were changed, but they never rea...
by robmar
Mon Aug 15, 2011 11:25 am
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Re: Direct texture memory updating

I've been trying that using the following code, but the update never reaches the screen. I have to copy to an intermediate texture created with AddTexture (the target was created with AddRenderTarget), and then use the code at the end. pBits = Buf->lock(); // Lock target ITexture hRet = m_pDDSurfTar...
by robmar
Sun Aug 14, 2011 11:49 pm
Forum: Advanced Help
Topic: Direct texture memory updating
Replies: 11
Views: 1691

Direct texture memory updating

Updating the pixel byte memory of a texture is uncomplicated with ITexture, however, there seems to be no method to mark the texture memory as changed, so any updates go unnoticed. Under D3D9, there are calls to AddDirtyRect and UpdateTexture, i.e. //upload mem-texture to render target on GPU memtex...