Skip to content

Instantly share code, notes, and snippets.

@vicrucann
vicrucann / osg-shader-polyline.cpp
Last active December 23, 2021 06:01
OpenSceneGraph simple geometry shader example: turns line adjacency into triangle strip (based on cinder line shader)
#include <Windows.h>
#include <osg/Camera>
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Group>
#include <osg/Node>
#include <osg/NodeVisitor>
#include <osg/Object>
@vicrucann
vicrucann / osg-shader-pass.cpp
Last active November 2, 2020 17:29
Pass through example of OpenSceneGraph vertex + shader shaders with OpenGL 4.00
#include <Windows.h> // comment if not Windows
#include <osg/Camera>
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Group>
#include <osg/Node>
#include <osg/NodeVisitor>
#include <osg/Object>
@vicrucann
vicrucann / CMakeLists.txt
Created June 14, 2016 18:08
OpenSceneGraph + QOpenGLWidget - minimal example
cmake_minimum_required(VERSION 2.8.11)
project(qtosg)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL)
find_package(OpenSceneGraph REQUIRED COMPONENTS osgDB osgGA osgUtil osgViewer)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
@vicrucann
vicrucann / CMakeLists.txt
Created June 14, 2016 17:58
OpenSceneGraph + QOpenGLWidget bug when using QTest
project(qtosg_tests)
cmake_minimum_required(VERSION 2.8.11)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Core 5.4 REQUIRED)
find_package(Qt5Gui 5.4 REQUIRED)