Jump to content

wraitii

WFG Programming Team
  • Posts

    3.455
  • Joined

  • Last visited

  • Days Won

    77

Posts posted by wraitii

  1. I'm not too sure about the CG compiler... And I'm not sure it would work given the architecture of the shaders themselves. It would be efficient, but for robustness, redoing them is probably the best way.

    I've committed the fix for the waterShader branch, it should work but there might be a place I forgot. The modelMapping branch will have to wait as I've started coding the Parallax stuff.

  2. 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.

  3. 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).

  4. Okay, so I've ported the water shader to ARB. It's been surprisingly straightforward, this time. The code and everything else works nicely, however, I'm not too sure how to push that to github/wherever... I'm not used to those things. Any tutorials/guidelines?

    While the water patch is extremely neat (the 3 shader files, and 4 lines modified in terrainRenderer.cpp), the other patch might be more messy (as I tried stuff, I may have modified tons of little things here and there in a few files).

    I'll check if it fixes the water bug on my MacBook Air when it's finished copying.

    BTW, I might give a shot at slightly improving the shader... The waviness factor is used in very weird ways.

  5. Yeah, from the looks of it I might be able to do a simple parallax, but I'd really doubt that given the very basic capabilities of ARB. I might be able to port the water shader, again, perhaps fixing that one bug I mentioned.

    I'll look into the GLSL problem, however. There's hardly a reason for it to crash that way.

    Edit: also, I must do the terrain specular/diffuse mapping, and perhaps give a look at trilinear texturing.

  6. I'll trust you on that one.

    Making some progress, but I wonder if there's something wrong with my normals, it doesn't react like i'd have expected it too... SHowing the normals after transformations, I get this. It sure isn't completely wrong, but it feels sort of weird (the marble in front for example… Why is it split in two?) Do you think this is correct?

    Also: you transpose the matrix (for the normal calculation). I'm not sure why... Apparently, it changes the behaviour of the vector*matrix multiplication done later. But as none of these two functions exist in ARB, you must do it yourself, and I'm not sure it's needed...

  7. The tangents are calculated on the CPU and then passed in to the shaders. I believe both the GLSL and ARB are invoked using the same code on the CPU side, and if Nvidia's compiler really works, it should know how to find them (as long as you set up the xml config).

    Actually, it looks like you're using glVertexAttribPointerARB() to pass the tangents to the shader, and as it happens, I do not believe this function does anything to the ARB shader... I'll take a look at the code and see if I can use an alternative for the ARB shaders.It's not as complicated as I initially thought.

    Edit: Nope, complicated indeed. I've understood how to pass a new uniform, but the tangents are stored in a weird pointer thingy that uses the GLSL only "VertexAttribPointer" function... It probably can be replaced by some variation of "glVertexAttrib4fv" but I have no idea which exactly.

×
×
  • Create New...