Normal values are not being passed in shader #4672
Replies: 3 comments
|
In your code, how do you connect the normal data from the OBJLoader to the one in your shader code? |
|
|
|
|
|
In your code, how do you connect the normal data from the OBJLoader to the one in your shader code? |
|
|
|
|
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I am using Sofa scene file to load obj files and draw them. Before running the draw function I am activating my shader.
myShader.use()
sofa::simulation::getSimulation()->draw(vparams, groot.get());
Then inside my vertex shader, I am taking position, normal as input
#version 330 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec3 normal;
The object is being drawn showing that position values are correctly taken as input. However when it comes to normal...
Then I visualized those normals. Below is an image
I checked inside Sofa's Meshobjloader.cpp file in function MeshOBJLoader::readOBJ. Normal values are printing correctly.
What could be the issue??
Any help is welcomed.
Thank You
All reactions