问题标签 [bump-mapping]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - Displacement map in three.js
I'm currently using a black and white image as a bump map for my model. The model is an .obj
file with the associated .mtl
file for UV mapping. This is the code I use:
At a latter time I add the bump map when I need it:
This works as expected but now I would like to use my texture as a displacement map instead of a bump map so I changed my code to:
With the same texture applied the displacement is no applied at all. Is there anything I need to change on my UV mapping or texture to work as the bump map but with displacement?
opengl - 在片段着色器中添加通用凹凸贴图
我有一个带有法线的 obj,我想在其上使用表面凹凸贴图。谁能帮助我如何从 obj 法线和凹凸贴图计算最终的法线贴图
我的片段着色器是:
现在我如何使用 interpolated.normal 添加该规范。它不能是直截了当的加法。
three.js - 三个js凹凸映射
我用三个 js (r85) 创建了一个简单的场景。它包含一个相机、一个灯光和一个平面几何网格。我还创建了一个渲染器目标,在其中使用 ShaderMaterial 渲染平面的凹凸贴图纹理。在片段着色器中,凹凸贴图使用连续函数(因此凹凸贴图应该是“平滑的”):
该代码呈现以下图像(奇怪的线条):
当我将凹凸贴图与 MeshPhongMaterial 一起使用时,会出现某种奇怪的线条。
请参阅此处的jsfiddle。
有人能告诉我那些奇怪的线条是什么以及如何避免这些吗?如果我对凹凸贴图使用简单的图像(不是渲染目标),则不会出现线条。
谢谢!
javascript - 通过对象加载器加载的场景,凹凸贴图未渲染
尝试将凹凸贴图应用到加载的对象,但在材质上看不到任何变化
我已经修复了这段代码的早期问题,包括对其应用细分修改器,但现在看来凹凸贴图拒绝应用。
c++ - 我的法线贴图有什么问题?C++ 直接
大家好,我正在尝试在 Directx 中实现法线映射,并且我非常接近创建它,但是我在某些对象上得到了这些奇怪的黑色。这是没有法线贴图的样子:
当我应用法线贴图效果时,它看起来是这样的:
我在例如墙壁和立方体的某些部分上得到黑色的地方很奇怪。
我的像素着色器文件如下所示:
我的顶点着色器看起来像这样:
我从 CPU 端计算每个顶点的 Binormal 和 Tangent 的方法是使用这种方法(取自 Rasterek Tutorial http://www.rastertek.com/dx11tut20.html):