Bump or height map for OglModel #2815
-
Hi, My question is simple, is there any way we can apply a normal map on an I would like to have this : instead of this : Thanks a lot for your help! Bruno |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hello @BrunoB81HK ! It is possible to have the same effect in SOFA but it is using a kind-of experimental/not really documented things from SOFA, as we realised that we should delegate advanced rendering to the dedicated software (unity, vedo with py3, etc) <Node name="Visual" >
<OglShader vertFilename="shaders/shaderLibrary.glsl" fragFilename="shaders/shaderLibrary.glsl" />
<OglModel name="organs_liver_gall" filename="m_organs_Liver.obj" putOnlyTexCoords="true" computeTangents="true" />
<OglTexture id="DiffuseMap" textureFilename="organs_liver_gall.png" textureUnit="1" />
<OglTexture id="NormalMap" textureFilename="organs_liver_gall_normalmap.png" textureUnit="2" />
<OglShaderDefineMacro id="DiffuseMap_Present" />
<OglShaderDefineMacro id="NormalMap_Present" />
<OglFloat3Variable id="LightPosition" value="@../../../light/position.value" />
<OglFloat3Variable id="LightColor" value="@../../../light/color.value" />
<OglFloat3Variable id="DiffuseColor" value="1 1 1" />
<OglFloat3Variable id="AmbientColor" value="0.3 0.3 0.3" />
<OglFloat3Variable id="SpecularColor" value="1 1 1" />
<OglFloatVariable name="SpecularRoughness" value="0.05" />
<OglFloatVariable name="SpecularReflectance" value="0.28" />
<BarycentricMapping name="visual mapping" input="@../mechanicalDofs" output="@organs_liver_gall" />
</Node> This is using a shader code present in the |
Beta Was this translation helpful? Give feedback.
-
Hello @BrunoB81HK Seems a bit too much to me 🧐 some tweaks would be needed I guess |
Beta Was this translation helpful? Give feedback.
Hello @BrunoB81HK
Actually, there was a problem in the OpenGL code #2855
After fixing the types, the normal mapping is working.
Seems a bit too much to me 🧐 some tweaks would be needed I guess