Okay, lessons learned:
1) Dirty video memory is real. I need to do a fill operation to the backup texture, like
backup_textures[i]->fill(video::SColor(255,0,0,0));
or the memcpy operation will copy whatever residual data there happens to be in the allocated area.
2) If multiple objects are ...
Search found 9 matches
- Fri May 15, 2026 1:04 pm
- Forum: Beginners Help
- Topic: Is it possible to alter a texture in real time on a pixel basis?
- Replies: 12
- Views: 1244
- Fri May 15, 2026 3:35 am
- Forum: Beginners Help
- Topic: Is it possible to alter a texture in real time on a pixel basis?
- Replies: 12
- Views: 1244
Re: Is it possible to alter a texture in real time on a pixel basis?
I spoke too soon. I tried it with another object, another texture, and with all the necessary commands to write a pixel rewritten from scratch and independent from the functions I wrote. In that case, all I get on the texture is random pixels instead of the pixel I want.
This is what I'm doing ...
This is what I'm doing ...
- Wed May 13, 2026 6:36 pm
- Forum: Beginners Help
- Topic: Is it possible to alter a texture in real time on a pixel basis?
- Replies: 12
- Views: 1244
Re: Is it possible to alter a texture in real time on a pixel basis?
Yes! Now it works!CuteAlien wrote: Wed May 13, 2026 5:46 pm So after texture->unlock() add: texture->regenerateMipMapLevels();
- Wed May 13, 2026 3:54 pm
- Forum: Beginners Help
- Topic: Is it possible to alter a texture in real time on a pixel basis?
- Replies: 12
- Views: 1244
Re: Is it possible to alter a texture in real time on a pixel basis?
Thank you for the corrections. I took the creation of the backup image outside the function that draws on it, then I noticed that my need to copy the texture to the backup image was a consequence of having it inside the function, so I fixed that too.
Now I made a number of other functions that let ...
Now I made a number of other functions that let ...
- Sun May 10, 2026 10:24 pm
- Forum: Beginners Help
- Topic: Is it possible to alter a texture in real time on a pixel basis?
- Replies: 12
- Views: 1244
Re: Is it possible to alter a texture in real time on a pixel basis?
You can also use the Irrlicht functions directly. Bascially - create an IImage and ITexture with same sizes and format. Work with the setPixel functions of IImage. Then as above use lock() on ITexture and lock() or getData on the IImage. Then copy the IImage data over to the texture. While that is ...
- Sun May 10, 2026 1:08 pm
- Forum: Beginners Help
- Topic: Is it possible to alter a texture in real time on a pixel basis?
- Replies: 12
- Views: 1244
Is it possible to alter a texture in real time on a pixel basis?
I want to obtain the effect of a virtual screen on which I can draw pixel by pixel while the program is running. At first, I tried following this naive approach:
// The virtual screen is created, one pixel at a time
for (x=0; x<VIRTUAL_SCREEN_WIDTH; x++)
{
for (y=0; y<VIRTUAL_SCREEN_HEIGHT; y ...
// The virtual screen is created, one pixel at a time
for (x=0; x<VIRTUAL_SCREEN_WIDTH; x++)
{
for (y=0; y<VIRTUAL_SCREEN_HEIGHT; y ...
- Tue Aug 15, 2023 2:37 pm
- Forum: Beginners Help
- Topic: How do I make objects attached to the camera never change their apparent size when I change the FOV?
- Replies: 8
- Views: 3062
Re: How do I make objects attached to the camera never change their apparent size when I change the FOV?
It worked. I didn't even have to touch the position and rotation of the second camera, because I attached the HUD to the second camera, so, even if the camera doesn't move, the HUD is always displayed correctly.
- Tue Aug 15, 2023 3:32 am
- Forum: Beginners Help
- Topic: How do I make objects attached to the camera never change their apparent size when I change the FOV?
- Replies: 8
- Views: 3062
Re: How do I make objects attached to the camera never change their apparent size when I change the FOV?
Where do I find an example where it's used?
- Sun Aug 13, 2023 2:35 pm
- Forum: Beginners Help
- Topic: How do I make objects attached to the camera never change their apparent size when I change the FOV?
- Replies: 8
- Views: 3062
How do I make objects attached to the camera never change their apparent size when I change the FOV?
I'm making a HUD for a space game. I'm taking inspiration from The Last Starfighter (see https://youtu.be/hafnDoApzpY?t=36 ), so the radar and attitude of the spaceship are represented by 3D spheres, attached to the camera node as children, which match the rotation of the camera.
I've implemented ...
I've implemented ...