If you use a reflective surface in your game that you render the scene to, I don´t think it gets updated until endscene is called.
This would mean that the reflective surface image is always one frame behind, which is okay if the animation movements are small and FPS high enough.
If not, the reflected image is out of sync with the main scene.
Is it possible to update the reflection texture before the scene is drawn to the framebuffer, to avoid this lag?
I tried putting the reflection texture update into its own beginscene-endscene, but it cause the frame buffer to flash.
Render to texture update pre endscene
Re: Render to texture update pre endscene
I´m using DX9, is it possible that the texture rendered to doesn´t get updated until the next begin-end sequence?
Can´t figure out why there is this frame delay
Can´t figure out why there is this frame delay
Re: Render to texture update pre endscene
You can always render to a rendertarget the reflective texture and render the main scene afterwards to have an updated render. Yes, you render twice, the other option is to go always a frame behind, although this has the advantage of not having to render the scene two times.
How do you render the relflections?
How do you render the relflections?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Render to texture update pre endscene
I render the scene first to the reflective texture, which is then needed in the final scene render.
I found the problem was that I had to add a call to AbsoluteUpdatePosition after setting the render camera´s position.
As I had called driver->Animate() before using the reflection camera (I duplicate Animate call in the driver and added this function, and also added a flag to drawAll() to skip the animation call within it), I didn´t think I needed to call AbsoluteUpdatePosition on the render camera node.
Any idea why this problem would occur?
I found the problem was that I had to add a call to AbsoluteUpdatePosition after setting the render camera´s position.
As I had called driver->Animate() before using the reflection camera (I duplicate Animate call in the driver and added this function, and also added a flag to drawAll() to skip the animation call within it), I didn´t think I needed to call AbsoluteUpdatePosition on the render camera node.
Any idea why this problem would occur?
Re: Render to texture update pre endscene
DrawAll "renders" the active camera to have valid camera values before any other render operation takes place, thus, you need to render manually the active camera to update its values.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Render to texture update pre endscene
Coooo never knew that one! Lost in the code... undocumented?... I should of stepped through all the source code first! 
Do we need to render others cameras each frame, or just call updateabsoluteposition?
Do we need to render others cameras each frame, or just call updateabsoluteposition?
Re: Render to texture update pre endscene
Mel,
You wrote: "DrawAll "renders" the active camera to have valid camera values before any other render operation takes place"
But the reflection water node code sets the active camera to the "reflection camera", and then calls drawAll, so shouldn´t that camera, as its active, get rendered?
So why do I need to call UpdateAbsolutePosition on the active camera after settings its position before call setactivecamera and drawall?
You wrote: "DrawAll "renders" the active camera to have valid camera values before any other render operation takes place"
But the reflection water node code sets the active camera to the "reflection camera", and then calls drawAll, so shouldn´t that camera, as its active, get rendered?
So why do I need to call UpdateAbsolutePosition on the active camera after settings its position before call setactivecamera and drawall?