2021-03-04 02:39 EST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003082FSSCPgraphicspublic2015-06-26 07:25
Assigned ToEchelon9 
Product Version 
Target VersionFixed in Version 
Summary0003082: gr.drawModel draws model inside out if rendering to texture
DescriptionIf the gr.drawModel scripting function is used for example in an $On Frame hook, it renders the model correctly, except if we're rendering to a texture, in which case the model gets rendered with its polys seemingly inverted.

I recently fixed some similar'ish bugs pertaining to the RTT code, but this one persists and I haven't been able to figure it out despite spending countless hours on it. I did conclude that it's not a case of the projection matrix being any different depending on whether doing RTT or not (except the difference due to target aspect ratio), and didn't find any indication of anything else being wrong with the setup of the matrices (gr_set_proj_matrix/gr_opengl_set_projection_matrix and gr_set_view_matrix/gr_opengl_set_view_matrix), but of course I might have missed something.

Attached is a simple test mod consisting only of one script, which 1) renders the player ship's model in front of the camera onto a texture and then 2) draws the texture in the top left corner of the screen.

The commented-out lines in the script are for using a custom camera, which isn't needed for reproducing but any fix should probably be tested with those lines uncommented as well, because in real usage one would almost always use a custom camera like that, and it might very well be affected by the fix one way or another.
TagsNo tags attached.
Attached Files


There are no notes attached to this issue.

-Issue History
Date Modified Username Field Change
2014-08-03 14:48 zookeeper New Issue
2014-08-03 14:48 zookeeper File Added: rtttestmod.zip
2015-06-26 07:25 Echelon9 Assigned To => Echelon9
2015-06-26 07:25 Echelon9 Status new => assigned
+Issue History