zoot Posted July 5, 2012 Report Share Posted July 5, 2012 (edited) Github is the ideal solution if you want feedback on your code so you can clean it up prior to it being submitted to Trac. They have many good tutorials themselves, starting here. You will want to fork myconid's repo once you're set up. It should all be quite simple and even enjoyable once you get started. Edited July 5, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
myconid Posted July 5, 2012 Author Report Share Posted July 5, 2012 (edited) Assuming you want to remove the messy bits, first go to github and find my repo, fork it and pull the modelmapping branch, copy over the files you are sure you want to change from whatever you are currently using, stage them, commit, push them to github and then initiate a pull request. This will let me merge them with my modelmapping branch.You may want to keep the water-related and model-related code changes separate, so see if you can create a new branch (from the master branch) for the water. Edited July 5, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
zoot Posted July 5, 2012 Report Share Posted July 5, 2012 You may want to keep the water-related and model-related code changes separate, so see if you can create a new branch (from the master branch) for the water.And if you don't know how to do branches just yet, I can even do them for you. Such is the glory of Git. Main thing is that you get the code up so we can begin tinkering with it. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 Thanks for the help. I'm off to eat, I'll try to push the water shader code in the afternoon.In the meantime, here's an album showing the differences. 1 Quote Link to comment Share on other sites More sharing options...
Jeru Posted July 5, 2012 Report Share Posted July 5, 2012 Shared showcase on FB with credit. Hope that is okay. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 It's quite allright .The water shader should be available here. I changed the GLSL script to give the same result as the ARB shader, but I'm not sure I haven't forgotten something so if the GLSL shader acts weirdly, report.I'll look into the modelmapping issue now. Quote Link to comment Share on other sites More sharing options...
myconid Posted July 5, 2012 Author Report Share Posted July 5, 2012 It's quite allright .The water shader should be available here. I changed the GLSL script to give the same result as the ARB shader, but I'm not sure I haven't forgotten something so if the GLSL shader acts weirdly, report.I'll look into the modelmapping issue now.Woah, careful. Why is your diff looking like this? Did you mangle the line endings? Quote Link to comment Share on other sites More sharing options...
zoot Posted July 5, 2012 Report Share Posted July 5, 2012 Woah, careful. Why is your diff looking like this? Did you mangle the line endings?Seems like it:$ file source/renderer/TerrainRenderer.cppsource/renderer/TerrainRenderer.cpp: ASCII English text, with CRLF line terminatorshistoric_bruno seemed to have issues with this too - maybe he can chime in with a solution... Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 (edited) Yeah, I've used windows endlines and not unix endlines. Fixed it now, but I didn't bother to when committing that.FYI, in that file, the only stuff that's changing is at lines 675/676/677/678 . Edited July 5, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
Shield Bearer Posted July 5, 2012 Report Share Posted July 5, 2012 Thanks for the help. I'm off to eat, I'll try to push the water shader code in the afternoon. In the meantime, here's an album showing the differences. Looks really cool Does this fix the shadow not falling on the water bug? Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 Haven't checked, but I would guess no. That would require to handle the shadow matrix differently, I think, which I have not done/changed. Quote Link to comment Share on other sites More sharing options...
Shield Bearer Posted July 5, 2012 Report Share Posted July 5, 2012 Ah, okay. Would be nice to have that fixed (if you get my flow) Quote Link to comment Share on other sites More sharing options...
WhiteTreePaladin Posted July 5, 2012 Report Share Posted July 5, 2012 I like the shadow on the bottom of the water. Can we have both simultaneously? Quote Link to comment Share on other sites More sharing options...
myconid Posted July 5, 2012 Author Report Share Posted July 5, 2012 Seems like a definite improvement, well done! I'll test it when I get home.Haven't checked, but I would guess no. That would require to handle the shadow matrix differently, I think, which I have not done/changed.wraitii, technically that's a feature request, not a bugfix. None of the shadowmapping-related stuff is passed into the water shader right now. If you want to try that, you first need to change the terrain renderer code to pass in the shadowmap and shadow transform, and then you need to add code to the shader to actually calculate the shadows. You can have a shot at it, or I might try it later.I like the shadow on the bottom of the water. Can we have both simultaneously?Yes. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 (edited) Okay, I've pushed the changes to the Modelmapping Branch. I've tried cleaning things up as most as I could, it should work still, but again, I'm not 100% sure. You will need to set "calculateTangents" to true in the game's config file (I haven't changed the warning set by Myconid, but it should now work).Specular and diffuse normal mapping should be visible on the model Rome_Temple_Mars 2, not yet on terrain. @Myconid: seeing how much trouble I've had with the two (in the end, fairly basic) patches, I'll try to give a look but I wouldn't swear I can do that.Edit: water patch doesn't seem to fix #966, sadly.Edit2: there may be hope for parallax mapping if the computer supports the GL extension "GL_NV_fragment_program2", which came out in 2004(and which my computer supports, so that's nice). Edited July 5, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
myconid Posted July 5, 2012 Author Report Share Posted July 5, 2012 (edited) Specular and diffuse normal mapping should be visible on the model Rome_Temple_Mars 2, not yet on terrain.The terrain shaders/renderer aren't finalised yet, so maybe you want to hold off on the terrain shader conversion (I'm hoping to get it done over the weekend).@Myconid: seeing how much trouble I've had with the two (in the end, fairly basic) patches, I'll try to give a look but I wouldn't swear I can do that.Okay, let me know if you need any help. Edit: water patch doesn't seem to fix #966, sadly.Sounds like a regression bug in Alpha 7. Maybe we could see what changed... This reminds me, some people are still having issues with the blinking shadowmap.Edit2: there may be hope for parallax mapping if the computer supports the GL extension "GL_NV_fragment_program2", which came out in 2004(and which my computer supports, so that's nice).I'd advise against that, as that's an Nvidia-only extension! Imho, loop unrolling is the safest way to do it, and maybe we can add preprocessor macros to scale the parallax quality...wraitii, you still have a problem with GLSL, don't you? We should really figure out what's causing it. Edited July 5, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
zoot Posted July 5, 2012 Report Share Posted July 5, 2012 (edited) This is what I get with the waterShader branch:Also, the surface is static (unanimated).By the way, does anyone know of a way to ascertain that I am using the ARB shader? Edited July 5, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
myconid Posted July 5, 2012 Author Report Share Posted July 5, 2012 By the way, does anyone know of a way to ascertain that I am using the ARB shader?If preferGLSL is false and you're using the Shader path, you're definitely using ARB shaders. Mess up the GLSL shaders, run the game, if you don't get an error... Quote Link to comment Share on other sites More sharing options...
zoot Posted July 5, 2012 Report Share Posted July 5, 2012 If preferGLSL is false and you're using the Shader path, you're definitely using ARB shaders. Mess up the GLSL shaders, run the game, if you don't get an error...Ah, yes. I deleted shaders/glsl. The result is the same.Also, I get this error:ERROR: Failed to compile fragment program 'shaders/arb/water_high.fp' (line 82): line 76, char 25: error: expected scalar suffixERROR: CRenderer::EndFrame: GL errors occurred Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 That's strange... There is no reason for it to crash at this particular point. You're sure you haven't changed anything?Does it work it you replace the line 76 with something like:POW fresnel, 0.5, 0.8;(I mean: no error. The result should be slightly messed up).@myconid: given that you're using a "while" loop, I have no idea how much I'd need to roll... And anyway the basic ARB shader also hasn't have an "IF" statement. I'll try with the extension and we'll see. Quote Link to comment Share on other sites More sharing options...
zoot Posted July 5, 2012 Report Share Posted July 5, 2012 (edited) That's strange... There is no reason for it to crash at this particular point. You're sure you haven't changed anything?I'm positive. I even did a 'git reset' and recompiled to be certain.Does it work it you replace the line 76 with something like:POW fresnel, 0.5, 0.8;If I do that, the error 'moves' to char 14:ERROR: Failed to compile fragment program 'shaders/arb/water_high.fp' (line 82): line 76, char 14: error: expected scalar suffixERROR: CRenderer::EndFrame: GL errors occurred Edited July 5, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
myconid Posted July 5, 2012 Author Report Share Posted July 5, 2012 8x for low quality, 16x for high quality. Variables can become constants to avoid conditionals. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 @Zoot: and by changing to POW fresnel, 1, 1; ?@Myconid: that would be an option. I'll look into that. Quote Link to comment Share on other sites More sharing options...
zoot Posted July 5, 2012 Report Share Posted July 5, 2012 (edited) According to this spec, the POW instruction takes 2 inputs while you seem to give it 3: Instruction Inputs Output Description ----------- ------ ------ -------------------------------- POW s,s ssss exponentiate Edited July 5, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 5, 2012 Report Share Posted July 5, 2012 Actually, since it's two inputs, but one output, it should work. The thing is that it seems to consider that "1.0" is not a scalar, for some reason... On my computer, there's no issue, which further baffles me. 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.