myconid Posted May 29, 2012 Author Report Share Posted May 29, 2012 Most likely it's a mesa r300 driver issue.You have an X1600? For some reason I thought you had the RV770-based card...Anyway, this definitely seems like either a driver or hardware problem. Based on what you just said, my best guess is that the shader is too long for your older card. That may be a result of actual hardware limitations, or there's a chance the driver is incorrectly trying to unroll the while loop and is thus generating a lot of useless code... Quote Link to comment Share on other sites More sharing options...
fabio Posted May 29, 2012 Report Share Posted May 29, 2012 OK, it can be left as is now, maybe there should be a switch to disable it. When merged I'll file a bug against mesa. Thanks for all this work! Quote Link to comment Share on other sites More sharing options...
fabio Posted May 29, 2012 Report Share Posted May 29, 2012 Also a couple of notes:the terrain flashing can't be seen on screenshot;all the minimap is shown (and not only the explored area), see my previous screenshot; Quote Link to comment Share on other sites More sharing options...
myconid Posted May 29, 2012 Author Report Share Posted May 29, 2012 In terrain_common.fs, in this statement: return (1.0/9.0)*dot(size.zxzx*size.wwyy, vec4(shadow2D(shadowTex, vec3(weight.zw, v_shadow.z)).X, shadow2D(shadowTex, vec3(weight.xw, v_shadow.z)).X, shadow2D(shadowTex, vec3(weight.zy, v_shadow.z)).X, shadow2D(shadowTex, vec3(weight.xy, v_shadow.z)).X));try changing the ".X" at the end of each line to either ".r" or ".a". One of them should work. Quote Link to comment Share on other sites More sharing options...
quantumstate Posted May 29, 2012 Report Share Posted May 29, 2012 I just tried this. It didn't have any effect on the shadow glitch. I have put a screenshot below, visually it flickers across the whole screen.The minimap problem only occurs when entities are being rendered. So viewing the shroud of darkness or an empty area of the map (had to create a custom on is atlas) makes the minimap look normal. This has no effect on the terrain flickering.Edit: (the red units are due to some debug code, not a bug) Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted May 29, 2012 Report Share Posted May 29, 2012 Whoa! Is that a "shadow glitch"? Looks like a terrain blending problem. Maybe both. Quote Link to comment Share on other sites More sharing options...
quantumstate Posted May 29, 2012 Report Share Posted May 29, 2012 The glitch occurs when there is no terrain blending going on but in that case it is just a smooth darkened area. The blended regions seem to be unaffected by the glitch. It only occurs when shadows are enabled and the shadow blending does not affect it. Quote Link to comment Share on other sites More sharing options...
myconid Posted May 29, 2012 Author Report Share Posted May 29, 2012 Changing from ".a" to ".r" on fglrx fixes it for me for some reason (FYI that change might have been left in the patch, the original was ".a"). It's odd that people are having trouble with terrain shadows but not with model shadows, since the same code is duplicated almost verbatim in both shaders.Like Ykkrosh mentioned earlier, the shadowmap is created as GL_INTENSITY, so all its channels should contain the same values. Maybe there's something not quite right with the shadow2D function, which is deprecated, though I can't tell.Mythos, I believe this is just a shadowmap issue, not a terrain blending issue. The artifacts are caused by the get_shadow function not affecting the ambient lighting. Quote Link to comment Share on other sites More sharing options...
fabio Posted May 30, 2012 Report Share Posted May 30, 2012 In terrain_common.fs, in this statement: return (1.0/9.0)*dot(size.zxzx*size.wwyy, vec4(shadow2D(shadowTex, vec3(weight.zw, v_shadow.z)).X, shadow2D(shadowTex, vec3(weight.xw, v_shadow.z)).X, shadow2D(shadowTex, vec3(weight.zy, v_shadow.z)).X, shadow2D(shadowTex, vec3(weight.xy, v_shadow.z)).X));try changing the ".X" at the end of each line to either ".r" or ".a". One of them should work.the .X was actually already a .r. Modifying to .a changed nothing here. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted May 31, 2012 Report Share Posted May 31, 2012 Build errors/warnings in VC2010:1>------ Build started: Project: graphics, Configuration: Release Win32 ------1> mikktspace.cpp1>..\..\..\source\graphics\mikktspace.cpp(31): warning C4627: '#include "mikktspace.h"': skipped when looking for precompiled header use1> Add directive to 'precompiled.h' or rebuild precompiled header1>..\..\..\source\graphics\mikktspace.cpp(440): warning C4005: 'NOINLINE' : macro redefinition1> ..\..\..\source\graphics\mikktspace.cpp(438) : see previous definition of 'NOINLINE'1>..\..\..\source\graphics\mikktspace.cpp(1896): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?1> weldmesh.cpp1>..\..\..\source\graphics\weldmesh.cpp(22): warning C4627: '#include "weldmesh.h"': skipped when looking for precompiled header use1> Add directive to 'precompiled.h' or rebuild precompiled header1>..\..\..\source\graphics\weldmesh.cpp(195): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "precompiled.h"' to your source?1> InstancingModelRenderer.cpp1>..\..\..\source\renderer\InstancingModelRenderer.cpp(166): warning C4189: 'faces' : local variable is initialized but not referenced1>..\..\..\source\renderer\InstancingModelRenderer.cpp(100): warning C4189: 'vertices' : local variable is initialized but not referenced1>..\..\..\source\renderer\InstancingModelRenderer.cpp(127): warning C4189: 'p' : local variable is initialized but not referenced1> MikktspaceWrap.cpp1>C:\Users\Ben\devel\ps\source\renderer/MikktspaceWrap.h(77): warning C4512: 'MikkTSpace' : assignment operator could not be generated1> C:\Users\Ben\devel\ps\source\renderer/MikktspaceWrap.h(8) : see declaration of 'MikkTSpace'1>..\..\..\source\renderer\MikktspaceWrap.cpp(44): warning C4100: 'iFace' : unreferenced formal parameter1>..\..\..\source\renderer\MikktspaceWrap.cpp(44): warning C4100: 'pContext' : unreferenced formal parameter1>..\..\..\source\renderer\MikktspaceWrap.cpp(89): warning C4100: 'fMagT' : unreferenced formal parameter1>..\..\..\source\renderer\MikktspaceWrap.cpp(89): warning C4100: 'fMagS' : unreferenced formal parameter1>..\..\..\source\renderer\MikktspaceWrap.cpp(89): warning C4100: 'fvBiTangent' : unreferenced formal parameter1> ModelRenderer.cpp1>C:\Users\Ben\devel\ps\source\renderer/MikktspaceWrap.h(77): warning C4512: 'MikkTSpace' : assignment operator could not be generated1> C:\Users\Ben\devel\ps\source\renderer/MikktspaceWrap.h(8) : see declaration of 'MikkTSpace'Some of the source files are missing #include "precompiled.h" as the first line of code.Not looked into this one: "'MikkTSpace' : assignment operator could not be generated"It compiled successfully after fixing the missing includes. There were no obvious bugs that I noticed with Radeon HD 6850 / Win7 64-bit Quote Link to comment Share on other sites More sharing options...
myconid Posted May 31, 2012 Author Report Share Posted May 31, 2012 It compiled successfully after fixing the missing includes. There were no obvious bugs that I noticed with Radeon HD 6850 / Win7 64-bit Thanks for testing! I'm relieved that it worked on Windows/MSVC without any important changes.No Nvidia users about? Do let me know how horribly and inexplicably it breaks on your hardware. Quote Link to comment Share on other sites More sharing options...
myconid Posted May 31, 2012 Author Report Share Posted May 31, 2012 This afternoon I got started on bumpy terrains. Just normal-mapping for now.http://imgur.com/a/gDdxZ#0Quite happy with the way it's turning out!Specular mapping is next. Should be good for things like snowed terrain. Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted June 1, 2012 Report Share Posted June 1, 2012 Very nice I've got an old Nvidia card (GeForce 7950 GT) and I'd love to test it, but I think I need an .exe? Quote Link to comment Share on other sites More sharing options...
myconid Posted June 1, 2012 Author Report Share Posted June 1, 2012 Very nice I've got an old Nvidia card (GeForce 7950 GT) and I'd love to test it, but I think I need an .exe?I'm afraid I don't have a Windows installation any more. If historic_bruno or another Windows user doesn't mind uploading a compiled binary, I'll upload a separate archive with the shaders and other files you'll need to run it. Quote Link to comment Share on other sites More sharing options...
plumo Posted June 1, 2012 Report Share Posted June 1, 2012 Well, I'm on windows 7 64bit with an Nvidia card ( GTX 560 Ti).I can test it if you provide some more detailed steps so I know what to do ( I don't know much about this) Quote Link to comment Share on other sites More sharing options...
myconid Posted June 1, 2012 Author Report Share Posted June 1, 2012 (edited) Well, I'm on windows 7 64bit with an Nvidia card ( GTX 560 Ti).I can test it if you provide some more detailed steps so I know what to do ( I don't know much about this)Well, either you need to build the engine from source, or you can wait until someone uploads the compiled executables for your system.Btw, bumpy specular terrain has arrived! Edited June 1, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
plumo Posted June 1, 2012 Report Share Posted June 1, 2012 I have the latest SVN revision on my comp. and i can compile it with express 2010.I don't know how to add your patch. But i ll check the topic. Quote Link to comment Share on other sites More sharing options...
myconid Posted June 1, 2012 Author Report Share Posted June 1, 2012 I have the latest SVN revision on my comp. and i can compile it with express 2010.I don't know how to add your patch. But i ll check the topic.In that case you might want to look at TortoiseSVN's documentation.After the patch is applied, don't forget to add#include "precompiled.h"at the beginning of "weldmesh.cpp" and "mikktspace.cpp" Quote Link to comment Share on other sites More sharing options...
myconid Posted June 1, 2012 Author Report Share Posted June 1, 2012 http://imgur.com/eo9Z1All together now!Model parallax + model normal-mapping + terrain normal-mapping + terrain specular + HDR + SSAO + bloom.TGIF! Quote Link to comment Share on other sites More sharing options...
Enrique Posted June 1, 2012 Report Share Posted June 1, 2012 Wow, very nice job myconid!! I thought it would take a lot of time to see this graphic enhacements in 0 AD I also need a windows .exe to test it in my Nvidia card or better instructions to compile it in windows myself The weird roof shadowing is due to the LOD on the parallax? Quote Link to comment Share on other sites More sharing options...
kosmo Posted June 1, 2012 Report Share Posted June 1, 2012 Hats off! Quote Link to comment Share on other sites More sharing options...
myconid Posted June 1, 2012 Author Report Share Posted June 1, 2012 Wow, very nice job myconid!! I thought it would take a lot of time to see this graphic enhacements in 0 AD I also need a windows .exe to test it in my Nvidia card or better instructions to compile it in windows myself The weird roof shadowing is due to the LOD on the parallax?Thanks. I'll release a new patch soon(-ish) & instructions to compile.The dark roof is because of parallax, though it's not a bug. The texture is mirrored, and it already contains shadows. So, when you look at it from the side you see just a part of the bumps that is either light or dark. Quote Link to comment Share on other sites More sharing options...
zoot Posted June 1, 2012 Report Share Posted June 1, 2012 Well done, mate. In your view, which effects are missing before the engine's capablities are on par with AoE3? Quote Link to comment Share on other sites More sharing options...
myconid Posted June 1, 2012 Author Report Share Posted June 1, 2012 Well done, mate. In your view, which effects are missing before the engine's capablities are on par with AoE3?Hmm... I think it's about even. Distance fog? (3 lines of code)A desaturation filter, maybe? (Also, 3 lines of code) Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 1, 2012 Report Share Posted June 1, 2012 Yep, looks like the big difference now is distance fog. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.