Skip to content

Commit

Permalink
Debugging on macos x86, some issues with p3d attribs
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Apr 24, 2024
1 parent 186cf90 commit e5fb416
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions modules/ar/src/panda3d-simulator/vpPanda3DBaseRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#if defined(VISP_HAVE_PANDA3D)

#include "load_prc_file.h"
#include <antialiasAttrib.h>

const vpHomogeneousMatrix vpPanda3DBaseRenderer::VISP_T_PANDA({
1.0, 0.0, 0.0, 0.0,
Expand Down Expand Up @@ -79,6 +80,7 @@ void vpPanda3DBaseRenderer::initFromParent(std::shared_ptr<PandaFramework> frame
void vpPanda3DBaseRenderer::setupScene()
{
m_renderRoot = m_window->get_render().attach_new_node(m_name);
m_renderRoot.set_antialias(AntialiasAttrib::M_none);
}

void vpPanda3DBaseRenderer::setupCamera()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ void main()
)shader";

const char *vpPanda3DGeometryRenderer::SHADER_FRAG_NORMAL_AND_DEPTH = R"shader(
#version 140
#version 120
varying vec3 oNormal;
varying float distToCamera;
void main()
{
vec3 n = normalize(oNormal);
Expand Down Expand Up @@ -203,6 +202,7 @@ void vpPanda3DGeometryRenderer::getRender(vpImage<vpRGBf> &normals, vpImage<floa
}
else if (m_normalDepthTexture->get_component_type() == Texture::T_unsigned_byte) {
unsigned char *data = (unsigned char *)(&(m_normalDepthTexture->get_ram_image().front()));
std::cout << "AAAAAAA" << std::endl;
for (unsigned int i = 0; i < normals.getSize(); ++i) {
normals.bitmap[i].B = (static_cast<float>(data[i * 4]) / 127.5f - 1.0);
normals.bitmap[i].G = (static_cast<float>(data[i * 4 + 1]) / 127.5f - 1.0);
Expand Down
2 changes: 1 addition & 1 deletion tutorial/ar/tutorial-panda3d-renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int main(int argc, const char **argv)
}

std::cout << "Initializing Panda3D rendering framework" << std::endl;
renderer.initFramework(false);
renderer.initFramework(true);

std::cout << "Loading object " << modelPath << std::endl;
NodePath object = renderer.loadObject(objectName, modelPath);
Expand Down

0 comments on commit e5fb416

Please sign in to comment.