FroggestSpirit
|
|
Reply #15 Posted on: March 23, 2014, 12:13:54 pm |
|
|
Joined: Mar 2013
Posts: 79
|
I'm having an issue with lighting on OGL 3 now. This is the game in OGL1.1 (how it should look) and this is the same thing in ogl3: It appears that it incorrectly does the lighting, or the vertex coloring... Any ideas?
|
|
|
Logged
|
This isn't easy to say, but…
|
|
|
|
FroggestSpirit
|
|
Reply #17 Posted on: March 24, 2014, 11:48:12 am |
|
|
Joined: Mar 2013
Posts: 79
|
can some of the code be copied over from OGL1.1, or would that be incompatible? I'm not familiar with OGL, but i could try and take a look into it.
|
|
|
Logged
|
This isn't easy to say, but…
|
|
|
TheExDeus
|
|
Reply #18 Posted on: March 24, 2014, 12:33:55 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
No, the reason why it's different is because they are made totally differently. GL1 has this thing called Fixed Function Pipeline - it basically means that it has predetermined things it can do and draw and so you cannot change anything. GL1 had vertex based (per-vertex) lighting with maximum 8 lights and limited amount of effects you could do. GL3 on the other hand requires you to do it all yourself. This is a lot harder, but it does mean a lot more customization. Like you can create normal mapping, per-pixel lighting, deffered shading and so on, but you have to do it yourself. To make GL3 compatible with GM and GL1, the default lighting system would require to remake vertex based lights in FFP. This was not properly done (sorry, my fault) and I haven't been able to go back to that yet. The shader used for drawing (including per-vertex lights) is here: https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL3/GL3shader.cppAnd the light system itself is here: https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL3/GL3d3d.cpp
|
|
|
Logged
|
|
|
|
TheExDeus
|
|
Reply #19 Posted on: March 25, 2014, 02:17:30 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Spirit, I got around to fixing some of the problems with lights. Right now they are here in this branch: https://github.com/enigma-dev/enigma-dev/commits/GL3-cleanupYou can try that or you could give me an example I could test on myself. The fixes implement point lights (were totally not in previously) and fixes many bugs that were happening with lights previously. At least examples like Mario work fine. I don't have many examples that use GM lights. I plan to make an extension that would invisibly replace the per-vertex lights with per-pixel lights (so all you would have to do is enable an extension). We currently don't have an easy system to use or replace shaders, so extensions will have to do for now.
|
|
|
Logged
|
|
|
|
FroggestSpirit
|
|
Reply #20 Posted on: March 26, 2014, 09:18:34 am |
|
|
Joined: Mar 2013
Posts: 79
|
Not sure if it's my video card, or the way i merged, but i got a black screen, even with project mario. I downloaded the zip from your repo, replaced the files in my ENIGMA folder, and rebuilt the dll (and cleared the enigma folder in program data). I'll probably wait until it gets merged with the zip installer, but i'm sure it would work if it works on project mario. I dont really have any examples to distribute though
|
|
|
Logged
|
This isn't easy to say, but…
|
|
|
|
Goombert
|
|
Reply #22 Posted on: March 26, 2014, 11:32:28 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Project Mario crashes for me now after I merged my branch again with Harri's stuff. Prior to that his last commits at least worked, as in no segfault, and the main menu would at least draw "PRESS START" and the main room would draw at least the water, skybox, and HUD.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #23 Posted on: March 26, 2014, 01:10:56 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Can you GDB and see what's causing the segfault? Because I just installed my branch from scratch in another directory and I can compile it fine. Here they are: The GL3 is slightly shinier for some reason (even though specular is disabled for now). GL1 and GL3 will never be pixel perfect match anyway. Also, how can I resize images in the forum?
|
|
« Last Edit: March 26, 2014, 04:44:51 pm by TheExDeus »
|
Logged
|
|
|
|
Goombert
|
|
Reply #24 Posted on: March 26, 2014, 03:03:37 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
I'll GDB right now. Use the following to resize images. [img width=xxx]url[/img] Edit: Weird, I am not getting the segfaults now. But here is what it looks like in GL3 At the main menu, I only see the "Press Start" text, everything else is black. Also GL3 runs significantly slower than GL1 (about 50% slower)
|
|
« Last Edit: March 26, 2014, 03:10:44 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #26 Posted on: March 26, 2014, 05:14:42 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
The log is too long to paste, but now I know why it's running so slow, you're outputting this debug info even in run mode, stop doing that.
But here is something in the log. And no my card is AMD, this issue should have occurred for you as well.
Closing game module and running if requested. Running "C:/Users/Owner/AppData/Local/Temp/egm2094161423945681335.exe" Shader[0] - Compilation failed - Info log: Shader log empty Shader[1] - Compilation failed - Info log: Shader log empty Program[0] - Uniform Light[0].Ls not found! Program[0] - Uniform Light[1].Ls not found! Program[0] - Uniform Light[2].Ls not found! Program[0] - Uniform Light[3].Ls not found! Program[0] - Uniform Light[4].Ls not found! Program[0] - Uniform Light[5].Ls not found! Program[0] - Uniform Light[6].Ls not found! Program[0] - Uniform Light[7].Ls not found! Program[0] - Uniform Material.Ks not found! Program[0] - Uniform Material.Shininess not found! Initializing audio system... Opening ALURE devices.
|
|
« Last Edit: March 26, 2014, 05:17:51 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #27 Posted on: March 26, 2014, 06:19:34 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
The log is too long to paste, but now I know why it's running so slow, you're outputting this debug info even in run mode, stop doing that. That is only outputted when compiling a shader. As that is only done once, then there is no real performance penalty. It's usually useful even when running in normal mode. So that is not the reason it's slow for you. For me GL3 (950FPS) is a little slower than GL1 (1100FPS), but not by a large margin. Not sure if it's just more radical for you or it's because of the shader problems you have. Shader[0] - Compilation failed - Info log: Shader log empty Shader[1] - Compilation failed - Info log: Shader log empty This is a problem though. It says that compilation failed, but without an error. And no my card is AMD, this issue should have occurred for you as well. I don't have an AMD card. I have an Nvidia. That is why I said why you probably have an issue and I don't have it. I do have an AMD in my laptop though. I will try that tomorrow. edit: I just did a quick test on my laptop now and I can partly replicate the sigsev. But did you also see "error 78: failed to open file for reading"? It happens just before sigsev and it's a LodePNG error. I haven't touched that thing. It's possible that it fails to load a file for some reason, but still tries to make and use a GL texture? It doesn't fail to load on my stationary PC. And I have copied all the files over. edit2: I also replicated your black screen bug and I get the same water thing on the AMD. But that happens on a very old exe (the one I compiled when I was testing the GL3 about 2 months ago). Are you sure you got that black screen thing only now after the branch pull? Try the master and see if you don't have the same problem. There is clearly some AMD stupidity going on. edit3: I just looked trough the resource loading code and we truly have no checks at all. Like the file loading goes 4 functions deep because of the abstraction and if the lowest function fails, then it just segfaults, because nothing is catching those functions. But still, I cannot figure out why it would suddenly fail at loading files.
|
|
« Last Edit: March 26, 2014, 06:47:08 pm by TheExDeus »
|
Logged
|
|
|
|
Goombert
|
|
Reply #28 Posted on: March 26, 2014, 08:12:09 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
That is only outputted when compiling a shader. As that is only done once, then there is no real performance penalty. What? No the log came out to be 50000000 lines long, apparantly it was outputting some vector coordinates every step, and I mean the fucking log was several mb's. You obviously forget to remove some other debug code from run mode or some shit. This is a problem though. It says that compilation failed, but without an error. Yes, those are fine, I actually want those output logs to show in the IDE somewhere, I may add a "Check syntax" to the shader editor but I think that would require JOGL. But you did miss this part of that little fragment of the log. Program[0] - Uniform Light[0].Ls not found! Program[0] - Uniform Light[1].Ls not found! Program[0] - Uniform Light[2].Ls not found! Program[0] - Uniform Light[3].Ls not found! Program[0] - Uniform Light[4].Ls not found! Program[0] - Uniform Light[5].Ls not found! Program[0] - Uniform Light[6].Ls not found! Program[0] - Uniform Light[7].Ls not found! Program[0] - Uniform Material.Ks not found! Program[0] - Uniform Material.Shininess not found!
But did you also see "error 78: failed to open file for reading"? No, never saw that one, but I've been getting random segfaults on games that don't use PNG loading. This appears to have happened just since updating to Windows 8. But that happens on a very old exe (the one I compiled when I was testing the GL3 about 2 months ago). Are you sure you got that black screen thing only now after the branch pull? Try the master and see if you don't have the same problem. No, It's behaved this way for me ever since you merged your branch. Sometimes it segfaults, sometimes it don't, and when it does it has always behaved the way I have described to you. There is clearly some AMD stupidity going on. I am going to go ahead and disagree.
|
|
« Last Edit: March 26, 2014, 08:16:55 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #29 Posted on: March 27, 2014, 01:52:13 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
What? No the log came out to be 50000000 lines long, apparantly it was outputting some vector coordinates every step, and I mean the fucking log was several mb's. You obviously forget to remove some other debug code from run mode or some shit. Ou that, yeah, it probably even outputs matrices or something. Not really important in the debug stage I am in with those changes. But you did miss this part of that little fragment of the log. That's not important. They are not used in the shader as specular component is disregarded (causes some clipping issues I didn't bother to fix, so I disabled it for time being). you merged your branch I didn't. You mean when you pulled my branch (sounds wrong ), but I get the idea. I will have to debug with my AMD laptop and figure out when it started to happen to me. I am going to go ahead and disagree. Well the black rendering is an AMD thing. That means the compiled shader for AMD is wrong, but it's still possible it's because of uniform caching. I will investigate. So it's very possible it is some AMD stupidity. They never liked OGL anyway. At least the level Nvidia loves it.
|
|
|
Logged
|
|
|
|
|