TA3D 0.5.0 TEST 6

Everything related to the code /
Tout ce qui touche au code
Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Fri Aug 15, 2008 8:24 pm

zuzuf wrote:a missing functionality ?

it's unbelievable since all is required for water rendering is FBO and GLSL !!

If a card doesn't support GLSL (shaders) well you won't be able to play recent games with it ... which isn't the case with ATI cards (they run at least Doom III based games). And FBO is the way to go to render to textures, and it's the case since several generation of video cards yet.

So maybe it's due to some extension not being handled properly by TA3D but I cannot be a missing functionality (unless you use some very old card ... like pre radeon 9*00)
OK, just finished tracing the crashing problem.
I modified this a bit from shader.cpp - Lots of reporting in.

- - - - -
void Shader::load(const String& fragmentFilename, const String& vertexFilename)
{
if (!g_useProgram)
return;

// Reset
pShaderProgram = glCreateProgramObjectARB();
pShaderVertex = loadVertexShader(vertexFilename);
pShaderFragment = loadFragmentShader(fragmentFilename);

LOG_DEBUG(LOG_PREFIX_SHADER << "glAttachObject Vertex");
// OpenGL - attach objects
glAttachObjectARB(pShaderProgram, pShaderVertex);
LOG_DEBUG(LOG_PREFIX_SHADER << "glAttachObject Vertex Done ");
LOG_DEBUG(LOG_PREFIX_SHADER << "glAttachObject Shader ");
glAttachObjectARB(pShaderProgram, pShaderFragment);
LOG_DEBUG(LOG_PREFIX_SHADER << "glAttachObject Shader Done");
LOG_DEBUG(LOG_PREFIX_SHADER << "glLinkProgramARB pShaderProgram");
glLinkProgramARB(pShaderProgram);
LOG_DEBUG(LOG_PREFIX_SHADER << "glLinkProgramARB pShaderProgram Done:");
GLint link = 0;
glGetObjectParameterivARB(pShaderProgram, GL_OBJECT_LINK_STATUS_ARB, &link);
if(link)
{
LOG_DEBUG(LOG_PREFIX_SHADER << "Successfully loaded shader: `" << fragmentFilename << "`");
pLoaded = true;
}
else
{
LOG_ERROR(LOG_PREFIX_SHADER << "Failed to load shader: `" << fragmentFilename << "`");
char log[10000];
GLsizei len = 0;
glGetInfoLogARB(pShaderProgram, 10000, &len, log);
LOG_ERROR(LOG_PREFIX_SHADER << log);
pLoaded = false;
}
}

- - - - -

When I run it I get the following consistently.

- - - - -

[Fri Aug 15 13:11:26 2008] [debug] [shader] Vertex shader: shaders/water_pass1.
vert` compiled
[Fri Aug 15 13:11:26 2008] [debug] [shader] Fragment shader:` shaders/water_pass
1.frag` compiled
[Fri Aug 15 13:11:26 2008] [debug] [shader] glAttachObject Vertex
[Fri Aug 15 13:11:26 2008] [debug] [shader] glAttachObject Vertex Done
[Fri Aug 15 13:11:26 2008] [debug] [shader] glAttachObject Shader
[Fri Aug 15 13:11:26 2008] [debug] [shader] glAttachObject Shader Done
[Fri Aug 15 13:11:26 2008] [debug] [shader] glLinkProgramARB pShaderProgram

- - - - -

This shows that the glLinkProgramARB is either causing the crash or being given bad data by the compiler. As an experiment I tried pulling the shaders from 0.4.2 where they work with no problems and the problem stayed the same.

I don't know enough to go further in C++, but it appears that someting in either opengl or allegro is out of kilter.
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Fri Aug 15, 2008 10:37 pm

looking at GLSL compiler's log may give us more information
=>;-D Penguin Powered

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Fri Aug 15, 2008 11:16 pm

zuzuf wrote:looking at GLSL compiler's log may give us more information
Where do I look for the logs??
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Sat Aug 16, 2008 1:03 am

Doors wrote:
zuzuf wrote:looking at GLSL compiler's log may give us more information
Where do I look for the logs??
Never Mind, I just added printout of glGetError, found out the compilation works fine, just not the assignment. So i took the g_useprogram check out of the way by commenting out the test and making it a false.

Found after that when the list doesn't scroll by a mach one that there are TDF and other parse errors. I believe that is what is causing the lack of opening credits.

MiliPili just turn the shader check off and recompile, it should launch now. It ran for me until it ran into lack of defined sounds for arm_disengage something.

I am looking for the parsing error causing that, 100+ lines of if else if is nuts, I am going to clean that up this time. The repeated calling of strstr is massive overhead and needs to go.

Good luck chasing the shader error down.
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Aug 16, 2008 10:01 am

I've fixed an error in the new TDF parser that might help ...
I think I can reproduce this crash with wine, if it's the same problem it'll be easier to fix :D
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Aug 16, 2008 12:37 pm

When looking at that, it is not really exciting...
http://www.libsdl.org/cgi/docwiki.cgi/F ... d_Direct3D

However I am not a SDL warrior, and I not intend to be :)
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Aug 16, 2008 12:44 pm

Thanks for the fix Zuzuf in the TDF parser, it helps me in another place :)
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Aug 16, 2008 2:02 pm

Direct3D support might not be as good as OpenGL support, but currently there are too much things to change to support both OpenGL and Direct3D, we'll see that later. Currently integration with OpenGL is good enough to use our GFX object as abstraction layer :D, so if replacing Allegro with SDL fixes our low level bugs, there will be no need to add Direct3D support, but as I said we'll see that later (also I cannot really test Direct3D code on my Linux system ...)
=>;-D Penguin Powered

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Sat Aug 16, 2008 7:47 pm

zuzuf wrote:I've fixed an error in the new TDF parser that might help ...
I think I can reproduce this crash with wine, if it's the same problem it'll be easier to fix :D
I grabbed the svn update, did a fresh mingw setup and tried a compile.

Get a lot of allegro for dos problems and a big BITMAP redeclaration error.

- - - - -

$ make
Scanning dependencies of target gfx
[ 1%] Building CXX object src/gfx/CMakeFiles/gfx.dir/gfx.obj
In file included from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/internal/alconfig.h:40,
from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/base.h:41,
from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro.h:25,
from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/alleggl.h:8,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../stdafx.h:107,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/gfx.cpp:24:
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/platform/aldjgpp.h:20:19: pc.h: No such file or directory
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/platform/aldjgpp.h:22:21: dpmi.h: No such file or directory
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/platform/aldjgpp.h:23:21: go32.h: No such file or directory
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/platform/aldjgpp.h:26:27: sys/farptr.h: No such file or directory
In file included from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/draw.h:66,
from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro.h:40,
from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/alleggl.h:8,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../stdafx.h:107,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/gfx.cpp:24:
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `void _putpixel(BITMAP*, int, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:413: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:413: error: `_farnspokeb' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `int _getpixel(BITMAP*, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:424: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:424: error: `_farnspeekb' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `void _putpixel15(BITMAP*, int, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:438: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:438: error: `_farnspokew' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `int _getpixel15(BITMAP*, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:449: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:449: error: `_farnspeekw' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `void _putpixel16(BITMAP*, int, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:463: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:463: error: `_farnspokew' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `int _getpixel16(BITMAP*, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:474: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:474: error: `_farnspeekw' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `void _putpixel24(BITMAP*, int, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:488: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:488: error: `_farnspokew' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:488: error: `_farnspokeb' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `int _getpixel24(BITMAP*, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:499: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:499: error: `_farnspeekl' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `void _putpixel32(BITMAP*, int, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:513: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:513: error: `_farnspokel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl: In function `int _getpixel32(BITMAP*, int, int)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:524: error: `_farsetsel' was not declared in this scope
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/inline/draw.inl:524: error: `_farnspeekl' was not declared in this scope
In file included from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro.h:77,
from C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/alleggl.h:8,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../stdafx.h:107,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/gfx.cpp:24:
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/platform/aldos.h: In function `void _set_color(int, const RGB*)':
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/platform/aldos.h:265: error: `outportb' was not declared in this scope
In file included from C:/Ta3d-Dev/bin/../lib/gcc/mingw32/3.4.5/../../../../include/windows.h:52,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../misc/../threads/mutex.h:8,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../misc/../threads/thread.h:25,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../misc/interface.h:21,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/../TA3D_NameSpace.h:32,
from C:/Ta3d-Dev/home/Ta3d/src/gfx/gfx.cpp:25:
C:/Ta3d-Dev/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wingdi.h: At global scope:
C:/Ta3d-Dev/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wingdi.h:1342: error: conflicting declaration 'typedef struct tagBITMAP BITMAP'
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/gfx.h:276: error: 'BITMAP' has a previous declaration as `typedef struct BITMAP BITMAP'
C:/Ta3d-Dev/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wingdi.h:1342: error: declaration of `typedef struct tagBITMAP BITMAP'
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/gfx.h:276: error: conflicts with previous declaration `typedef struct BITMAP BITMAP'
C:/Ta3d-Dev/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wingdi.h:1342: error: declaration of `typedef struct tagBITMAP BITMAP'
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/gfx.h:276: error: conflicts with previous declaration `typedef struct BITMAP BITMAP'
C:/Ta3d-Dev/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wingdi.h:1342: error: declaration of `typedef struct tagBITMAP BITMAP'
C:/Ta3d-Dev/home/Ta3d/src/tools/win32/include/allegro/gfx.h:276: error: conflicts with previous declaration `typedef struct BITMAP BITMAP'
make[2]: *** [src/gfx/CMakeFiles/gfx.dir/gfx.obj] Error 1
make[1]: *** [src/gfx/CMakeFiles/gfx.dir/all] Error 2
make: *** [all] Error 2

- - - - -

Mingw w/gcc 3.4.5 & cmake 2.6 & allegro 4.2.2 etc, The same as I have been using.
Is this trying to compile allegro?

Not sure where to go next, any idea's ?
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Sat Aug 16, 2008 7:49 pm

zuzuf wrote:Direct3D support might not be as good as OpenGL support, but currently there are too much things to change to support both OpenGL and Direct3D, we'll see that later. Currently integration with OpenGL is good enough to use our GFX object as abstraction layer :D, so if replacing Allegro with SDL fixes our low level bugs, there will be no need to add Direct3D support, but as I said we'll see that later (also I cannot really test Direct3D code on my Linux system ...)
From what I have been able to find SDL should let you pretty well ignore D3D and focus on opengl with SDL doing the translating as needed.
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Aug 16, 2008 10:06 pm

I don't know why, but I can't reproduce the crash any more with wine ...

it doesn't try to build allegro, but since it needs its headers to build TA3D it uses Allegro's files. The BITMAP redefinition is due to a windows header being included before allegro's headers ... it's really strange that it only happens on windows and not on my mingw32 cross compiler :evil:

As far as SDL is concerned, I'd focus on OpenGL ... and then well Direct3D isn't supported on my platform :P
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sun Aug 17, 2008 7:23 pm

For my part, the implementation of Direct3D is far better than the OpenGL one on most of Windows system thaht I have seen. That's why I prefer more high-level frameworks instead of SDL, which offer the same API whatever the back-end.

TA3D does not compile on Windows, the allegro headers are not the good one. Sorry, it seems I always have more work in holidays than usual ...
Damien Gerard
Ta3d & Yuni Developer

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Sun Aug 17, 2008 7:26 pm

milipili wrote:For my part, the implementation of Direct3D is far better than the OpenGL one on most of Windows system thaht I have seen. That's why I prefer more high-level frameworks instead of SDL, which offer the same API whatever the back-end.

TA3D does not compile on Windows, the allegro headers are not the good one. Sorry, it seems I always have more work in holidays than usual ...
test 7 does compile once you fix a couple of cmake generated files.
Look at the 050 test 7 section for the exact files.
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sun Aug 17, 2008 7:54 pm

Maybe, but it is not the good headers anyway :)
Damien Gerard
Ta3d & Yuni Developer

Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests