Home Forums GAMES106 现代图形绘制流水线原理与实践 作业1渲染内容有问题

Viewing 2 reply threads
  • Author
    Posts
    • #16515 Score: 0
      Bayonetta_zs
      Participant

      首先我刚开始学习Vulkan和图形学相关知识,第一次写shder和vulkan的程序。

      目前按照提示把skinning项目里面的代码摘取出来了有用的片段,拷贝到了homework1的代码中,但是我一旦gl_position和outNormal加入了skinMat的矩阵,结果就会出问题

      mat4 skinMat = inJointWeights.x * jointMatrices[int(inJointIndices.x)] + inJointWeights.y * jointMatrices[int(inJointIndices.y)] + inJointWeights.z * jointMatrices[int(inJointIndices.z)] + inJointWeights.w * jointMatrices[int(inJointIndices.w)];
      

      gl_Position = uboScene.projection * uboScene.view * primitive. Model * skinMat * vec4(inPos.xyz, 1.0);

      outNormal = mat3(uboScene.view * primitive. Model *skinMat) * inNormal;
      
      能运行,但是结果是没有任何东西的画面,参见附件1(加入了skinMat的结果.jpg)
      我又用了skinning里面的模型,动画能播放,但是人物是扭曲的,参见附件2(加了skinMat用了skinning模型的结果.jpg)
      
      但是我去掉skinMat,就能复现原始静态demo的样子,能看到模型本身,参见附件3(去掉skinMat一切恢复“正常”的结果.jpg)
      

      gl_Position = uboScene.projection * uboScene.view * primitive. Model * vec4(inPos.xyz, 1.0);
      `outNormal = mat3(uboScene.view) * inNormal;

      我感觉是skinMat传到shader的数据出问题了,但是debug了半天毫无头绪,请老师或者各位助教和大牛们帮忙给下思路,不知道该怎么做了。

      附件4是我两个shader和homework1.cpp三个文件的压缩包,保留了原始目录结构。

      Attachments:
      You must be logged in to view attached files.
    • #16627 Score: 0
      psklf
      Participant

      这个模型没有 skin 不需要 skinmat

    • #17373 Score: 0
      winsomeresort
      Participant

      Rehabilitation hospitals are designed to address the unique needs of patients who require intensive rehabilitation services. Unlike traditional hospitals that primarily focus on acute care Rehabilitation Hospital in Nangloi rehabilitation hospitals specialize in long-term recovery. They cater to a diverse range of conditions, including but not limited to stroke, spinal cord injuries, traumatic brain injuries, amputations, and orthopedic surgeries.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.