Page 1 of 1

Render to texture, opengl

PostPosted: Tue Nov 03, 2009 9:06 am
by migel
Hi,
There is a ticket https://sourceforge.net/apps/trac/axiom ... ticket/103 (closed)
that render to texture doesnt work on opengl. I downloaded latest svn but it still crashes.

Re: Render to texture, opengl

PostPosted: Tue Nov 03, 2009 10:35 am
by Borrillis
migel wrote:Hi,
There is a ticket https://sourceforge.net/apps/trac/axiom ... ticket/103 (closed)
that render to texture doesnt work on opengl. I downloaded latest svn but it still crashes.

Open it back up with details. I tested it before I closed it and it works on Win7 x64. If you configuration is different, the ticket didn't specify those conditions.

Re: Render to texture, opengl

PostPosted: Wed Nov 04, 2009 12:06 pm
by migel
Ok, I re-opened it.

Im using XP and tried this two different computers (two different graphics cards, both using XP), same problem.
I looked it a bit and figured that props.Modes.Count is 0 in GLFBORTTManager.cs and thats the why it crashes at line 285.

Re: Render to texture, opengl

PostPosted: Fri Nov 13, 2009 12:35 pm
by Borrillis
Can you paste your log file ? There should be a line in there like :
  Code:
[GL] : Valid FBO targets


followed by a list of targets.

Re: Render to texture, opengl

PostPosted: Sat Nov 14, 2009 3:43 pm
by migel
Ok, now tried just it with W7(x32), does not work (with 4870). And my second computer has x1650 but even on linux I cant get it to work (unless I removed these lines which causes problem). But here is piece of log:

[10:36:58] [GL] : Valid FBO targets PF_UNKNOWN PF_A8
[10:36:58] ---RenderSystem capabilities---
[10:36:58] -Adapter Name:
[10:36:58] -Driver Version:
[10:36:58] -Available texture units: 16
[10:36:58] -Maximum lights available: 8
[10:36:58] -Hardware generation of mip-maps: yes
[10:36:58] -Texture blending: yes
[10:36:58] -Anisotropic texture filtering: yes
[10:36:58] -Dot product texture operation: yes
[10:36:58] -Cube Mapping: yes
[10:36:58] -Hardware stencil buffer: yes
[10:36:58] -Stencil depth: 8 bits
[10:36:58] -Two sided stencil support: no
[10:36:58] -Wrap stencil values: yes
[10:36:58] -Hardware vertex/index buffers: yes
[10:36:58] -Vertex programs: yes
[10:36:58] -Max vertex program version: arbvp1
[10:36:58] -Fragment programs: yes
[10:36:58] -Max fragment program version: arbfp1
[10:36:58] -Texture compression: yes
[10:36:58] -DXT: yes
[10:36:58] -VTC: no
[10:36:58] -Scissor rectangle: yes
[10:36:58] -Hardware Occlusion Query: no
[10:36:58] -User clip planes: yes
[10:36:58] -VertexElementType.UBYTE4: yes
[10:36:58] -Infinite far plane projection: yes
[10:36:58] -Max Point Size: 8192
[10:36:58] -Vertex texture fetch: yes
[10:36:58] -Max vertex textures: 16
[10:36:58] -Vertex textures shared: yes
[10:36:58] Registering ResourceManager for type Texture


(dont know why adapter name and driver version dont show anything, I didnt remove these)


-
I have newest ATI's drivers.

Re: Render to texture, opengl

PostPosted: Sun Nov 15, 2009 6:43 am
by Borrillis
I am going to go out on a limb here and guess that both of the cards you tested on were ATI? According to Axiom, your card does not support FBO and only ARB vertex and pixel shaders, which after looking up your card is obviously not the case.

Re: Render to texture, opengl

PostPosted: Sun Nov 15, 2009 8:26 am
by migel
Yes, both are ATI cards. But they support FBO because if I set manually depthFormat and stencilFormat by changing these lines (285 and 286)

  Code:
         
  depthFormat = _depthFormats[ props.Modes[ bestmode ].Depth ];
  stencilFormat = _stencilFormats[ props.Modes[ bestmode ].Stencil ];


to
  Code:
         depthFormat = 8;
         stencilFormat =8;


then it works with opengl (because props.Modes causes the crash (props.Modes.Count==0)).

Re: Render to texture, opengl

PostPosted: Mon Nov 16, 2009 11:18 am
by Borrillis
Please paste your entire log file for me, thanks.

And if you are using SVN, get the latest and see if my latest commit fixed your problem.

Otherwise this was the change :
  Code:
if ( fmt != Gl.GL_NONE && _atiMode && ( depths[ 0 ] == 0 || depths[ 1 ] == 0 || depths[ 2 ] == 0 ) )


in GLFBORTTManager.cs Line 416.

Re: Render to texture, opengl

PostPosted: Tue Nov 17, 2009 12:14 pm
by migel
Downloaded the lastest version from svn and now it works (both computers, w7 & xp).

In case you still like to see the log, it's http://axiom.pastebin.com/m49c78e83

Re: Render to texture, opengl

PostPosted: Tue Nov 17, 2009 12:45 pm
by Borrillis
migel wrote:Downloaded the lastest version from svn and now it works (both computers, w7 & xp).

In case you still like to see the log, it's http://axiom.pastebin.com/m49c78e83


Excellent, in that case I will close the bug for good now ;)