Re: Irrlicht Port

#141
ricky_daniel13 wrote:I'm having some problems. When the demo starts I just see a black screen and the Blink and Stamina metters. I can hear my character moving when I try to move, but I don't see anything. I tried pausing and a Blank pause menu came on the screen
That's because the shaders are incompatible with your hardware, which is my fault for not making them fully standard-compliant (implicit int-to-float conversion isn't allowed). MWATTT created a fix which was added to the project, you can see that here. And the latest demo doesn't have anything that you see in the screenshots, so the menu is empty. Once I have some basic AI working, a new demo and video will be uploaded.
WillWow_mc wrote:So... this isn't so much an SCP:CB port, but more of a different SCP game?
Not really, considering that most, if not all, assets from SCP-CB will be used in this project without any editing, and for the same reasons they are used in the original game.

Re: Irrlicht Port

#142
juanjpro wrote: That's because the shaders are incompatible with your hardware, which is my fault for not making them fully standard-compliant (implicit int-to-float conversion isn't allowed). MWATTT created a fix which was added to the project, you can see that here. And the latest demo doesn't have anything that you see in the screenshots, so the menu is empty. Once I have some basic AI working, a new demo and video will be uploaded.
I guess I just replace the files in the shaders folder with the fixed ones, right?
Image

Re: Irrlicht Port

#144
ricky_daniel13 wrote:I guess I just replace the files in the shaders folder with the fixed ones, right?
Yes.
ricky_daniel13 wrote:Hey, just wondering, since the port its still in a early state, can multiple language support be added?
It should be easy to do at any stage of development.

Re: Irrlicht Port

#145
I've tried to run the lastet git on my old PC to see those errors.
For a radeon x300SE on Windows, I got a black screen with following log:
Spoiler
Irrlicht Engine version 1.8.1
Microsoft Windows XP Professional Service Pack 3 (Build 2600)
Using renderer: OpenGL 2.1.8545
ATI Radeon X300/X550/X1050 Series: ATI Technologies Inc.
OpenGL driver version is 1.2 or better.
GLSL version: 1.2
Vertex shader compilation failed at position 895:
line 27: invalid texture coordinate
Pixel shader compilation failed at position 477:
line 14: invalid texture coordinate
Resizing window (1280 720)
OpenAL initialized successfully
Seed: 27808522
GLSL shader program failed to link
Fragment shader(s) failed to link, vertex shader(s) linked.
Fragment Shader not supported by HW
GLSL shader program failed to link
Fragment shader(s) failed to link, vertex shader(s) linked.

GLSL shader program failed to link
Fragment shader(s) failed to link, vertex shader(s) linked.
Fragment Shader not supported by HW
In addition to linking problem, it semms that two Irrlicht's internal shaders failed to compile.
The linux FOSS driver is however more explicit:
Spoiler
Irrlicht Engine version 1.8.1
Linux 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:01 UTC 2014 i686
Creating X window...
Visual chosen: : 458
Using renderer: OpenGL 2.1
Gallium 0.4 on ATI RV370: X.Org R300 Project
OpenGL driver version is 1.2 or better.
GLSL version: 1.2
OpenAL initialized successfully
Seed: -633419462
GLSL shader program failed to link
error: shader uses too many input components (56 > 40)

GLSL shader program failed to link
error: shader uses too many input components (44 > 40)
More that, a shader failed to run because it use too many ALU instructions.

AFAIK, the limit is the same for R300 and R500 so it may be the same problem for the radeon X1300.
Unfortunatly, the Windows driver is no longer updated since March 2009 for these cards, so drivers bug will not be corrected on Windows.

The best workarround might be a game option that allow to use a simpler shader for these hardware (I can try to do that).

I've also tried with an Nvidia 7500LE:
Spoiler
Irrlicht Engine version 1.8.1
Linux 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:31:23 UTC 2014 i686
Creating X window...
Visual chosen: : 39
Using renderer: OpenGL 2.1.2
GeForce 7500 LE/PCIe/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 1.2
OpenAL initialized successfully
Seed: -556307508
GLSL shader program failed to link
Fragment info
-------------
0(15) : error C5041: cannot locate suitable resource to bind parameter "oTlightPos3"
0(16) : error C5041: cannot locate suitable resource to bind parameter "oTlightPos4"
0(18) : error C5041: cannot locate suitable resource to bind parameter "oLightColor1"
0(19) : error C5041: cannot locate suitable resource to bind parameter "oLightColor2"
0(20) : error C5041: cannot locate suitable resource to bind parameter "oLightColor3"
0(21) : error C5041: cannot locate suitable resource to bind parameter "oLightColor4"

GLSL shader program failed to link
Fragment info
-------------
0(12) : error C5041: cannot locate suitable resource to bind parameter "oLightColor2"
0(13) : error C5041: cannot locate suitable resource to bind parameter "oLightColor3"
0(14) : error C5041: cannot locate suitable resource to bind parameter "oLightColor4"
Everything is drawn exept items. SCP-173 and 066 are black. The input limit for this Nvidia card is 32.

Re: Irrlicht Port

#146
I should find a way to save up some resources, then. I'm pretty sure the if statements in NewNormalVert.vert do more bad than good, so it might be a good idea to get rid of them and let the GPU optimize stuff by itself.

AFAIK Irrlicht doesn't come with GLSL shaders, the built-in ones are ARB.

Edit: could you figure out which shader failed to run because of the ALU instruction limit?
Edit 2: lowered NewNormal's varying count from 56 to 28.

Re: Irrlicht Port

#147
Now there is one less GLSL link failure with radeon x300 on Linux (haven't tested on windows yet).
I still have on with the "lighting" shader:
Spoiler
GLSL shader program failed to link
error: shader uses too many input components (44 > 40)
but the other is gone.

The compiler error was with shader "PostProcessFrag.frag". Exact message:
Spoiler
r300 FP: Compiler Error:
../../../../../../src/gallium/drivers/r300/compiler/r300_fragprog_emit.c::emit_alu(): Too many ALU instructions
Using a dummy shader instead.
The message is displayed at run-time. However, a second one is displayed, probably related to "NewNormalFrag.frag" now that it links. All R300 are SM2 hardware so they support a very limited ammount of instructions (64 for fragment shader). The Radeon x1300 may works because it's a SM3 with 512 ALU instructions in fragment shader.

However, for an unknown reaseon, the Nvidia 7500 still won't link the NewNormalFrag:
Spoiler
GLSL shader program failed to link
Fragment info
-------------
0(8) : error C5041: cannot locate suitable resource to bind parameter "olightPos"
0(8) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
It may be a driver bug as it seems to works on Nouveau (I cannot be sure because Nouveau is very unstable, but SCP-173's texture is displayed).

Re: Irrlicht Port

#148
The issues I need to fix are still the same, too many varyings for your hardware. Unfortunately the only way to get rid of them is to reduce the amount of lights supported by the shaders.

The PostProcess frag shader probably breaks because of the math involved in transforming the ZBuffer texture into a float. I'll change the ZBuffer shader to use a 32-bit red channel-only texture, so this math is removed.