ok i found wmc's demo code for rtt through scripting and went through it to make it function under recent builds.
;;render targets
#Global Hooks
$SIMULATION:
[
--Check for target_set variable, we only need to do this once
if not target_set then
--Create a texture to draw on
--'tex' will always be nil under OpenGL
tex = gr.createTexture(256, 256, TEXTURE_DYNAMIC)
--If tex was successful, then go ahead with the drawing
if tex:isValid() then
--Set that texture as the current drawing/rendering buffer
gr.CurrentRenderTarget = tex
--Set current color to grey
gr.setColor(64, 64, 64)
--Draw rectangle on entire texture
gr.drawRectangle(0, 0, 255, 255, true)
--Set color to green
gr.setColor(0, 255, 0)
--Write "Hello, world!"
gr.drawString("Hello, world!", 0, 0)
--Switch back to drawing on the screen
gr.CurrentRenderTarget = nil
--Switch to ship to change textures for
ship = mn.Ships["Alpha 1"]
if ship:isValid() then
--Assuming this is a Ulysses, set all textures to our new one
ship.Textures['fighter01-01a'] = tex
ship.Textures['fighter01-01b'] = tex
ship.Textures['fighter01-01c'] = tex
end
end
--Set the variable so we don't re-do this every frame
target_set = true
end
]
#end
you will note that it doesnt work. now i know that rtt is working in thje engine under ogl, because thats how env mapping works. but the scripting interface to rtt is broke, or im not using it right. i looked on mantis to see what knd of progress was made on it, but noone reported it. so i figured id post a report bercause this is a feature i need for something im working on.
anyway i just wanted a solid example of the problem i could post with the report. sence ive never actually been able to get ttis to work, i need to make sure my adaptation of the script is supposed to work. i need some other scripters and maybe wmc to go over this and make sure its correct.