did my armor patch make this?
i also want to verify the status of rtt cameras. there was an issue of a render frame call only using 1/8th of the resolution of the texture. im about to test this.
simple rtt debug script is fail.
what should happen:
rear view camera texture should draw on hud and fill the box (as seen in 3.6.12).
what happens now:
the screen is black, the empty box in which the texture should go still draws to the black screen.
what should have been the contents of the texture is rendered in a tiny square it the bottom left of the screen,
partially obscured by the box which denotes where the texture should draw.
;rtt test script
;creates a rear view camera, then renders it to texture
;this texture is drawn to fill the green and blue box on the hud
;image should completely fill the box
#Conditional Hooks
$Application: FS2_Open
$State: GS_STATE_GAME_PLAY
$On State Start:
[
tex = gr.createTexture(255,255,TEXTURE_DYNAMIC)
cam = gr.createCamera("rearview")
]
$On Frame:
[
ship = mn.Ships["Alpha 1"]
if cam:isValid() and ship:isValid() and tex:isValid() then
--attatch camera to the ship
cam.Self = ship
--point camera backwards
cam.Orientation = ba.createOrientation(0,0,math.pi)
cam.Position = ba.createVector(0,0,-15)
--set render target
gr.CurrentRenderTarget = tex
--backfill
gr.clearScreen(0,0,0,255)
--set camera
gr.setCamera(cam)
--draw scene
mn.renderFrame()
--reset camera
gr.setCamera()
--reset target
gr.CurrentRenderTarget = nil
--draw textures on hud
x1,y1,x2,y2 = 8, gr.getScreenHeight()-tex:getHeight()-8, tex:getWidth()+8, gr.getScreenHeight()-8
--draw debug square first
gr.setColor(0,0,255,255)
gr.drawRectangle(x1,y1,x2,y2,true)
gr.setColor(0,254,0,255)
gr.drawLine(x1-1,y1-1,x2+1,y1-1)
gr.drawLine(x1-1,y2+1,x2+1,y2+1)
gr.drawLine(x1-1,y1-1,x1-1,y2+1)
gr.drawLine(x2+2,y1-1,x2+2,y2+1) --draw primitives are still innacurately positioned, lol
--now draw the texture
gr.drawImage(tex,x1,y1,x2,y2)
end
]
$On State End:
[
tex:unload()
]
#end