Results 1 to 10 of 18

Thread: Normal mapping

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    I made a tool for nxPascal that's able to create a normalmap texture, when the object normals are known. Naturally it's rough, but if there is a high quality model available in addition to low quality, then the result can be good. After little blurring maybe... I created a 12k triangle sphere for the normal map, and using 800 triangle model in the attached demo. This way i can be sure that color red means normal (1, 0, 0), exactly where the texture coordinate tells. Added some noise on gray background for specular map.

    I already met 2 testers who had just black screen. Reason for other being that gl_Vertex stuff isn't even supported by his new card anymore, i think. Other had little different error, i assume his card is older than mine though. But i have improved the shaders error logging greatly after that, it should tell exactly what's wrong, and write it in errorlog.txt.

    The attached project is standalone Lazarus project, included nxPascal files needed to compile and run. It's still buggy with light directions, and to help testing, i'm using 3 of the objects in the scene. 1 of them is rotating. Also i do not know why ambient light isn't taken into account. Dark side of each object should not be completely black, but they seem so.
    Control keys are: W, S, A, D, Spacebar, C, and mouse dragging

    Also just narrowed down the ambient color to this in fragment shader:
    Code:
    gl_FragColor = gl_FrontMaterial.ambient * texture2D(colorMap, gl_TexCoord[0].xy);
    So gl_FrontMaterial.ambient returns black. I don't know why, it is set to higher color in main program.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by User137; 15-10-2012 at 06:04 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •