Request: write to all of cubemap texture

Miscellaneous Forums/General Discussion/Request: write to all of cubemap texture

It would be extremely handy, in Blitz3D, and a dam sight faster if we could write to the whole cubemap texture, instead of just updating individual cubemap faces. The reason being, it takes so long to do. And the reason for updating the whole cubemap is for dot3 mapping purposes.

Using a cubemap, updates dot3 lighting without worrying about vertex normals and such with animated models. The cubemap does all that for you.

However, to move the light sources, you need to rotate the cubemap. This is achieved by placing a camera inside a cube, mapped with the various faces of a cubemap colour texture for normals. Then you take 6 renders, copying each side to the appropriate face on the cubemap.

Now, this takes a long time to do, so, using cameraviewport and using 6 cameras, you can place the camera viewports in a line, just like a cubemap texture, with the 6 faces being shown. You simple copyrect the whole strip to the cubemap texture, and you only need one copyrect. Alot quicker than 6, and makes the dot3 alot more useful.

I understand blitz is a product that is only going to receive bug updates at the most, but i'm chancing my arm that's it's a simple thing to change :o)

Thank you for reading/listening and sorry for the double post. Shouldn't have been in the blitz3d bug reports...

I never liked cubemaps, either too static and too much work or if combined with rtt it can get too gpu intensive for low range systems.

with careful use cubemapping is fast enough. copyrect is pretty fast and is definitely, for now, faster than the render call itself when there is a semi-complex scene loaded.

Toms dx7test dll with render to texture is definitely a few worlds faster than copyrect :)

Problem still exists that you need 6 of them

As far as I'm aware, it fundamentally isn't possible. Even with DX9 - to the best of my knowledge - you cannot render to all six faces at once. This is why point light shadowmapping is so slow without clever optimization. Each face is bound separately. I don't think it became possible until DX10, and I doubt anyone would be in favour of making Blitz3D Vista-only.

Ah, if that's the case then it doesn't matter :o) I'll try tom's dx7test dll, thanks guys :o)

Ross C: Yes you need 6 of them, but there are 2 fundamental points you forget:

1. Render2Texture is far faster than render to backbuffer and grab
2. You don't need to do it realtime. Its enough if "enough" has changed -> light moved far enough, object moved far enough or the relative rotation has changed enough.
There is no usefull reason to alter them each frame or even all 3 frames ... ever 50-100 ms is normally by far enough.

Well, you would notice the difference, as it's used to update cubemap lighting :o) And if you had vertex lighting going on at the same time, it wouldn't look right. Especially if the character is very close to a light source and the light changes fairly rapidly.

You would however, i agree, you only need to update 3 sides as these would only be in view.

As for point 1, i'm going to check this out. Seems like the logical choice.

No you will not notice the difference. Thats exactly the point of number 2.
If nothing to nearly nothing changes, the user will not realize as the dot3 is per texel anyway, not per pixel, so no chance to realize it!

And don't worry about vertex lighting -> it will not work, even if you fake the lighting with cubemaps as the dot3 will "eat" the effect.