myconid Posted July 7, 2012 Author Report Share Posted July 7, 2012 Been AFK, just compiled. I also got a segfault when loading the temple model. Fixed by setting gentangents to true.Now it almost works, though things look a bit l slanted to the side: Quote Link to comment Share on other sites More sharing options...
zoot Posted July 7, 2012 Report Share Posted July 7, 2012 Been AFK, just compiled. I also got a segfault when loading the temple model. Fixed by setting gentangents to true.Indeed. I get the slanting too: Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 7, 2012 Report Share Posted July 7, 2012 (edited) That's fairly weird... Looks like some problem with the eyedir or the move parameters. I'll see if I can reproduce.BTW, I'd recommend using this texture for the normal: it has no black pixels (the alpha channel is [1-255], as having alpha = 0 means a black pixel), so the lighting is less weird and the parallax too on the rooftiles (see Myconid screenshot for weird lighting).Edit: yeah, I'm getting the slanting too... Even when I use the loops and stuffs, so it must be somewhere in the calculations. Edited July 7, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 7, 2012 Report Share Posted July 7, 2012 (edited) Got it, I was normalizing the EyeDir vector too soon (in the vertex program) and it resulted in the slanting. I commited the changes.I've also changed the shader slightly to use only 7 texCoord and not 8 (changes nothing for most people, I guess). Edited July 7, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
zoot Posted July 7, 2012 Report Share Posted July 7, 2012 Excellent. Quote Link to comment Share on other sites More sharing options...
myconid Posted July 7, 2012 Author Report Share Posted July 7, 2012 Nice, fixed here too.The model's much too bright, though! Something must be wrong with your normal mapping. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 7, 2012 Report Share Posted July 7, 2012 (edited) Nah, I actually called "sundir", and I had forgot to initialize this variable, so the sun direction never changed and was completely buggy. It's fixed.I've committed an update to the waterShader branch: the size of waves is now scaling with the waviness parameter, so with low waviness you'll get an even better feeling of "little wind". Edited July 7, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
zoot Posted July 7, 2012 Report Share Posted July 7, 2012 I've committed an update to the waterShader branch: the size of waves is now scaling with the waviness parameter, so with low waviness you'll get an even better feeling of "little wind".I'm getting:ERROR: Failed to compile fragment program 'shaders/arb/water_high.fp' (line 47): line 46, char 1: error: syntax error, unexpected BIN_OP, expecting ';'ERROR: CRenderer::EndFrame: GL errors occurred Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 7, 2012 Report Share Posted July 7, 2012 I forgot a ";" on the line before. Quote Link to comment Share on other sites More sharing options...
zoot Posted July 7, 2012 Report Share Posted July 7, 2012 I forgot a ";" on the line before.That worked, but there seems to be an issue with the water shader and the SoD:When I enable the water shader under 'Settings', water is rendered even in the areas that are supposed to be covered by SoD. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 7, 2012 Report Share Posted July 7, 2012 (edited) Can't seem to be able to reproduce it... What map? Do you get any errors?(I assume you're using the ARB shader... I also modified the GLSL shader so both could crash). Edited July 7, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
zoot Posted July 7, 2012 Report Share Posted July 7, 2012 (edited) I get no errors. It's on the 'Tropical Island' map with ARB.Edit: It also happens on Punjab 3, so I assume all maps (with water) are affected. Edited July 7, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
k776 Posted July 8, 2012 Report Share Posted July 8, 2012 @myconid Been tracking the changes in your Github. Nice progress. Any change you could have a branch which merges all the work together? It's nicer to try all the things together. Quote Link to comment Share on other sites More sharing options...
zoot Posted July 8, 2012 Report Share Posted July 8, 2012 When I enable the water shader under 'Settings', water is rendered even in the areas that are supposed to be covered by SoD.wraitii has fixed this in the latest commit:While on the topic of the water shader, does any of you know if we could reduce tiling artifacts by adding some Perlin noise? Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 8, 2012 Report Share Posted July 8, 2012 Probably an easier way would be to use 256x256 textures instead of the 128x128 the game is using now. The scaling issue is actually mainly visible in huge zones of open sea with little waviness in the latest version, because in this case I repeat the texture more so the waves appear smaller. Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 8, 2012 Report Share Posted July 8, 2012 I got the grass effect to work, myconid... Looks really nice (though of course lighting is still not really supported). I think you could try to use less layers if you simulated rotating each grass layer to face the camera (in the fragment shader). Quote Link to comment Share on other sites More sharing options...
zoot Posted July 8, 2012 Report Share Posted July 8, 2012 Probably an easier way would be to use 256x256 textures instead of the 128x128 the game is using now. The scaling issue is actually mainly visible in huge zones of open sea with little waviness in the latest version, because in this case I repeat the texture more so the waves appear smaller.It's less apparent on small bodies of water, but I'd say there is still a subtle repetitiveness that makes it feel more artificial than it has to be. Quote Link to comment Share on other sites More sharing options...
myconid Posted July 8, 2012 Author Report Share Posted July 8, 2012 @myconid Been tracking the changes in your Github. Nice progress. Any change you could have a branch which merges all the work together? It's nicer to try all the things together. Ok.While on the topic of the water shader, does any of you know if we could reduce tiling artifacts by adding some Perlin noise? Best way to do it is to overlay two different layers of the water texture, one with a slightly scaled UV mapping (e.g. 1.3x the normal one). Should be pretty easy, if you'd like to give it a try.I think you could try to use less layers if you simulated rotating each grass layer to face the camera (in the fragment shader).Not sure how that could work... Quote Link to comment Share on other sites More sharing options...
zoot Posted July 8, 2012 Report Share Posted July 8, 2012 (edited) Best way to do it is to overlay two different layers of the water texture, one with a slightly scaled UV mapping (e.g. 1.3x the normal one). Should be pretty easy, if you'd like to give it a try.Yeah, that could probably work too. Can you give me some pointers to how to do that? Would it be similar to the layers you did for the grass? Edited July 8, 2012 by zoot Quote Link to comment Share on other sites More sharing options...
myconid Posted July 8, 2012 Author Report Share Posted July 8, 2012 (edited) Yeah, that could probably work too. Can you give me some pointers to how to do that? Would it be similar to the layers you did for the grass?Nope, it can be done straight from the water shader. Just access the water texture twice, multiplying the UVs with the scaling factor the second time, and then add or multiply the two values together before doing anything else. Or "mix" them:mix(col1, col2, amount);amount = 0.5 mixes them equally. Edited July 8, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
myconid Posted July 8, 2012 Author Report Share Posted July 8, 2012 ERMAHGERDhttps://github.com/myconid/0ad/tree/mergedMERGED Quote Link to comment Share on other sites More sharing options...
zoot Posted July 8, 2012 Report Share Posted July 8, 2012 ERMAHGERDhttps://github.com/m...0ad/tree/mergedMERGEDIs it useful to debug on this branch? I get this:And the following errors:ERROR: CCacheLoader failed to find archived or source file for: ""ERROR: CCacheLoader failed to find archived or source file for: ""I've tried resetting the cache, but the issue persists.This is the commit I am using:$ git log | headcommit 9f80921728f89c15673b89575cd92a1fa0338470Author: myconid <christofi.cos@gmail.com>Date: Sun Jul 8 15:11:07 2012 +0300 merged & ready Quote Link to comment Share on other sites More sharing options...
myconid Posted July 8, 2012 Author Report Share Posted July 8, 2012 (edited) Debugging is always useful.Clear your cache? Whoops, saw it^^The problem must be on your end. Make sure your local copy is in sync. You did recompile, right? Edited July 8, 2012 by myconid Quote Link to comment Share on other sites More sharing options...
wraitii Posted July 8, 2012 Report Share Posted July 8, 2012 (edited) @Myconid: I mean stretching the texture sampling (of the grass) in a perpendicular direction to the eyeDir... I'm not sure how to calculate that, but it could perhaps be done.BTW... I still get the normal problem with this code: vec3 normal = mat3(instancingTransform) * a_normal; #if (USE_NORMAL_MAP || USE_PARALLAX_MAP) vec4 tangent = vec4(mat3(instancingTransform) * a_tangent.xyz, a_tangent.w);And not using this code: vec3 normal = (instancingTransform * vec4(a_normal,0.0) ).rgb; #if (USE_NORMAL_MAP || USE_PARALLAX_MAP) vec4 tangent = vec4( (instancingTransform * vec4(a_tangent.xyz,0.0)).rgb, a_tangent.w);Both should work the same, but it appears "mat3" doesn't work properly on my computer.I can confirm the "bi" water sampling, but I've found it to look slightly weird as the two move at different speeds. Edited July 8, 2012 by wraitii Quote Link to comment Share on other sites More sharing options...
zoot Posted July 8, 2012 Report Share Posted July 8, 2012 (edited) The problem must be on your end. Make sure your local copy is in sync. You did recompile, right? No. Edited July 8, 2012 by zoot 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.