29 |
30 | SceniX Viewer
31 |
32 |
33 |
35 | Built on the NVIDIA SceniX 7 scene management engine. 36 |
37 |2011 NVIDIA Corporation, NVIDIA, the NVIDIA logo, and SceniX are 38 | trademarks or registered trademarks of NVIDIA Corporation in the U.S. and/or other countries. 39 | All rights reserved. 40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /dp/sg/xbar/culling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | #includes 3 | include_directories( 4 | ) 5 | 6 | #definitions 7 | add_definitions( 8 | -DDP_SG_XBAR_CULLING_EXPORTS 9 | ) 10 | 11 | #sources 12 | set(XBAR_CULLING_SOURCES 13 | src/Culling.cpp 14 | src/CullingImpl.cpp 15 | src/ResultImpl.cpp 16 | ) 17 | 18 | set(XBAR_CULLING_PUBLIC_HEADERS 19 | Config.h 20 | Culling.h 21 | ) 22 | 23 | set(XBAR_CULLING_PRIVATE_HEADERS 24 | inc/ResultImpl.h 25 | inc/CullingImpl.h 26 | ) 27 | 28 | source_group(sources FILES ${XBAR_CULLING_SOURCES}) 29 | source_group(headers FILES ${XBAR_CULLING_PRIVATE_HEADERS}) 30 | source_group("" FILES ${XBAR_CULLING_PUBLIC_HEADERS}) 31 | 32 | #target 33 | add_library( DPSgXbarCulling SHARED 34 | ${XBAR_CULLING_SOURCES} 35 | ${XBAR_CULLING_PUBLIC_HEADERS} 36 | ${XBAR_CULLING_PRIVATE_HEADERS} 37 | ) 38 | 39 | target_link_libraries( DPSgXbarCulling 40 | DPSgCore 41 | DPUtil 42 | DPMath 43 | DPCulling 44 | DPCullingCPU 45 | DPCullingOpenGL 46 | ) 47 | 48 | set_target_properties( DPSgXbarCulling PROPERTIES FOLDER "DP/SG/Xbar" ) 49 | set_target_properties( DPSgXbarCulling PROPERTIES COMPILE_DEFINITIONS DP_SG_XBAR_CULLING_EXPORTS ) 50 | -------------------------------------------------------------------------------- /test/sgrdr/modules/sg_benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package( OpenGL REQUIRED ) 2 | find_package( GLEW REQUIRED ) 3 | 4 | FILE (GLOB tests ${linkunit}/*) 5 | 6 | set( LINK_SOURCES "" ) 7 | 8 | add_definitions( 9 | "-D_CRT_SECURE_NO_WARNINGS" 10 | ) 11 | 12 | FOREACH( test ${tests} ) 13 | if( IS_DIRECTORY ${test} ) 14 | if( EXISTS ${test}/CMakeLists.txt ) 15 | string( REGEX REPLACE "^.*/([^/]*)$" "\\1" TEST_NAME ${test} ) 16 | if( NOT (${TEST_NAME} MATCHES "^__") ) 17 | add_subdirectory( ${TEST_NAME} ) 18 | endif() 19 | endif() 20 | endif() 21 | ENDFOREACH( test ${tests} ) 22 | 23 | include_directories( 24 | "${GLEW_INCLUDE_DIRS}" 25 | ) 26 | 27 | if (TARGET DPTSgRdr) 28 | add_library( ${LINK_NAME} SHARED 29 | ${LINK_SOURCES} 30 | ) 31 | 32 | target_link_libraries( ${LINK_NAME} 33 | ${GLEW_LIBRARY} 34 | DPTcore 35 | DPUtil 36 | DPTRiX 37 | RiXCore 38 | RiXGL 39 | DPTestManager 40 | DPHelpers 41 | DPTSgRdr 42 | DPSgIO 43 | DPSgGenerator 44 | DPSgCore 45 | DPSgRdrRiXGL 46 | ) 47 | 48 | add_dependencies( ${LINK_NAME} DPHelpers ) 49 | 50 | endif() 51 | 52 | -------------------------------------------------------------------------------- /media/dpfx/mdl/mdl_base_flowNoiseBumpTexture.glsl: -------------------------------------------------------------------------------- 1 | vec3 mdl_base_flowNoiseBumpTexture( in _base_textureCoordinateInfo uvw, in float factor, in float size, in float phase, in int levels, in bool absoluteNoise 2 | , in float levelGain, in float levelScale, in float levelProgressiveUScale, in float levelProgressiveVMotion, in vec3 normal ) 3 | { 4 | float delta = 0.1f * size; 5 | 6 | float r0 = flowNoise( uvw.position.xy / size, phase, levels, absoluteNoise, levelGain, levelScale, levelProgressiveUScale, levelProgressiveVMotion ); 7 | float r1 = flowNoise( ( uvw.position + delta * uvw.tangentU ).xy / size, phase, levels, absoluteNoise, levelGain, levelScale, levelProgressiveUScale, levelProgressiveVMotion ); 8 | float r2 = flowNoise( ( uvw.position + delta * uvw.tangentV ).xy / size, phase, levels, absoluteNoise, levelGain, levelScale, levelProgressiveUScale, levelProgressiveVMotion ); 9 | float r3 = flowNoise( ( uvw.position + delta * normal ).xy / size, phase, levels, absoluteNoise, levelGain, levelScale, levelProgressiveUScale, levelProgressiveVMotion ); 10 | 11 | return( normalize( normal - factor * ( ( r1 - r0 ) * uvw.tangentU + ( r2 - r0 ) * uvw.tangentV + ( r3 - r0 ) * normal ) ) ); 12 | } 13 | -------------------------------------------------------------------------------- /dp/cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(GLEW REQUIRED) 2 | find_package(CUDA) 3 | 4 | if (CUDA_FOUND) 5 | #includes 6 | include_directories( 7 | ${CUDA_INCLUDE_DIRS} 8 | ${GLEW_INCLUDE_DIRS} 9 | ) 10 | #definitions 11 | add_definitions( 12 | -DDP_CUDA_EXPORTS 13 | ${CUDA_DEFINITIONS} 14 | ${GLEW_DEFINITIONS} 15 | ) 16 | 17 | #sources 18 | set(SOURCES 19 | src/Buffer.cpp 20 | src/Buffer3D.cpp 21 | src/BufferHost.cpp 22 | src/Device.cpp 23 | src/Event.cpp 24 | src/GraphicsResource.cpp 25 | src/Stream.cpp 26 | ) 27 | 28 | set(HEADERS 29 | Buffer.h 30 | Buffer3D.h 31 | BufferHost.h 32 | Config.h 33 | Device.h 34 | Event.h 35 | GraphicsResource.h 36 | Stream.h 37 | Types.h 38 | ) 39 | 40 | source_group(sources FILES ${SOURCES}) 41 | source_group(headers FILES ${HEADERS}) 42 | 43 | #target 44 | cuda_add_library( DPCUDA SHARED 45 | ${SOURCES} 46 | ${HEADERS} 47 | ) 48 | 49 | target_link_libraries( DPCUDA 50 | DPGL 51 | DPUtil 52 | ) 53 | 54 | set_target_properties( DPCUDA PROPERTIES FOLDER "DP/CUDA" ) 55 | 56 | else() 57 | message("CUDA not found, disabling DPCUDA") 58 | endif() 59 | -------------------------------------------------------------------------------- /dp/sg/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0020 OLD) 3 | 4 | FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*) 5 | 6 | FOREACH( linkunit ${linkunits} ) 7 | if( IS_DIRECTORY ${linkunit} ) 8 | if( EXISTS ${linkunit}/CMakeLists.txt ) 9 | string( REGEX REPLACE "^.*/([^/]*)$" "\\1" LINK_NAME ${linkunit} ) 10 | add_subdirectory( ${LINK_NAME} ) 11 | endif() 12 | endif() 13 | ENDFOREACH( linkunit ${linkunits} ) 14 | 15 | 16 | #includes 17 | 18 | #definitions 19 | add_definitions( 20 | -DDP_SG_IO_EXPORTS 21 | ) 22 | 23 | #sources 24 | set(SOURCES 25 | src/IO.cpp 26 | src/PlugInterface.cpp 27 | ) 28 | 29 | set(PRIVATE_HEADERS 30 | ) 31 | 32 | set(PUBLIC_HEADERS 33 | Config.h 34 | IO.h 35 | PlugInterface.h 36 | PlugInterfaceID.h 37 | ) 38 | 39 | source_group(source FILES ${SOURCES}) 40 | source_group(header FILES ${PRIVATE_HEADERS}) 41 | source_group("" FILES ${PUBLIC_HEADERS}) 42 | 43 | #target 44 | add_library( DPSgIO SHARED 45 | ${SOURCES} 46 | ${HEADERS} 47 | ${PUBLIC_HEADERS} 48 | ) 49 | 50 | target_link_libraries( DPSgIO 51 | DPSgCore 52 | DPUtil 53 | ) 54 | 55 | set_target_properties( DPSgIO PROPERTIES FOLDER "DP/SG" ) 56 | -------------------------------------------------------------------------------- /media/effects/xml/standard_material/glsl/BezierTriangle.glsl: -------------------------------------------------------------------------------- 1 | 2 | // Evaluate a bezier triangle given by 10 vertices in bezierPoints at the sample point uvw 3 | // calculate normal at that point, as well 4 | vec3 evalBezierTriangle( in vec3 bezierPoints[10], in vec3 uvw, out vec3 normal ) 5 | { 6 | vec3 p10 = uvw.x * bezierPoints[0] + uvw.y * bezierPoints[1] + uvw.z * bezierPoints[4]; 7 | vec3 p11 = uvw.x * bezierPoints[1] + uvw.y * bezierPoints[2] + uvw.z * bezierPoints[5]; 8 | vec3 p12 = uvw.x * bezierPoints[2] + uvw.y * bezierPoints[3] + uvw.z * bezierPoints[6]; 9 | vec3 p13 = uvw.x * bezierPoints[4] + uvw.y * bezierPoints[5] + uvw.z * bezierPoints[7]; 10 | vec3 p14 = uvw.x * bezierPoints[5] + uvw.y * bezierPoints[6] + uvw.z * bezierPoints[8]; 11 | vec3 p15 = uvw.x * bezierPoints[7] + uvw.y * bezierPoints[8] + uvw.z * bezierPoints[9]; 12 | 13 | vec3 p20 = uvw.x * p10 + uvw.y * p11 + uvw.z * p13; 14 | vec3 p21 = uvw.x * p11 + uvw.y * p12 + uvw.z * p14; 15 | vec3 p22 = uvw.x * p13 + uvw.y * p14 + uvw.z * p15; 16 | 17 | vec3 p30 = uvw.x * p20 + uvw.y * p21 + uvw.z * p22; 18 | 19 | vec3 du = normalize( p21 - p20 ); 20 | vec3 dv = normalize( p22 - p20 ); 21 | normal = normalize( cross( du, dv ) ); 22 | 23 | return( p30 ); 24 | } 25 | -------------------------------------------------------------------------------- /dp/sg/io/XML/Loader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(NVTinyXML) 2 | 3 | if (TINYXML_FOUND) 4 | #includes 5 | include_directories( 6 | "${CMAKE_CURRENT_SOURCE_DIR}" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/inc" 8 | include_directories( ${TINYXML_INCLUDE_DIRS} ) 9 | ) 10 | 11 | #definitions 12 | add_definitions( 13 | -DXMLLOADER_EXPORTS 14 | ) 15 | 16 | if(WIN32) 17 | add_definitions("/wd4996") 18 | endif() 19 | 20 | 21 | #sources 22 | set(XMLLOADER_SOURCES 23 | XMLLoader.cpp 24 | ) 25 | 26 | set(XMLLOADER_HEADERS 27 | XMLLoader.h 28 | ) 29 | 30 | source_group(source FILES ${XMLLOADER_SOURCES}) 31 | source_group(header FILES ${XMLLOADER_HEADERS}) 32 | 33 | #target 34 | add_library( XMLLoader SHARED 35 | ${XMLLOADER_SOURCES} 36 | ${XMLLOADER_HEADERS} 37 | ) 38 | 39 | target_link_libraries( XMLLoader 40 | DP 41 | DPSgCore 42 | DPMath 43 | DPUtil 44 | DPSgIO 45 | ${TINYXML_LIBRARIES} 46 | ) 47 | 48 | if (WIN32) 49 | set_target_properties( XMLLoader PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:msvcrt" ) 50 | endif(WIN32) 51 | 52 | set_target_properties( XMLLoader PROPERTIES SUFFIX ".nxm" FOLDER "DP/SG/IO") 53 | else() 54 | message("TinyXML not found, disabling XMLLoader") 55 | endif() 56 | -------------------------------------------------------------------------------- /media/dpfx/emitColorOITAllCounter.glsl: -------------------------------------------------------------------------------- 1 | // emitColor is the function called at the end of the fragment shader to emit the calculated color 2 | // There are a couple of emitColor functions (like in emitColorDepth.glsl, emitColorOITAllCounter.glsl, etc.) which reflect 3 | // the various needs of the various algorithms. 4 | 5 | // Version of emitColor() used in OITAll in the depth pass for transparent fragments. 6 | // This function counts the number of samples per fragment. That number of color values 7 | // needs to be gathered in the non-depth pass. 8 | 9 | // enable early depth test to prevent the expensive fragment shader on samples that 10 | // are already covered by opaque samples 11 | layout(early_fragment_tests) in; 12 | 13 | layout(size1x32) uniform restrict uimage2D perFragmentCount; // 2D image sized as the view to count the samples per fragment 14 | 15 | layout(location = 0, index = 0) out vec4 Color; 16 | 17 | void emitColor( in vec4 color ) 18 | { 19 | // atomically add one to the number of samples on this fragment (this is used in the transparent pass only!) 20 | imageAtomicAdd( perFragmentCount, ivec2( gl_FragCoord.xy ), uint(1) ); 21 | 22 | Color = vec4( 0 ); // the actual color doesn't matter, as this is just the depth pass 23 | } 24 | -------------------------------------------------------------------------------- /dp/math/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(DPMath) 2 | 3 | add_definitions("-DDP_MATH_EXPORTS") 4 | 5 | include_directories(${DP_HOME}) 6 | 7 | set(PUBLIC_HEADERS 8 | Beziernt.h 9 | Boxnt.h 10 | Config.h 11 | math.h 12 | Matmnt.h 13 | Planent.h 14 | Quatt.h 15 | Spherent.h 16 | Trafo.h 17 | Vecnt.h 18 | ) 19 | 20 | #let cmake determine linker language 21 | set(SOURCES 22 | src/Math.cpp 23 | src/Matmnt.cpp 24 | src/Quatt.cpp 25 | src/Trafo.cpp 26 | ) 27 | 28 | #sse versions 29 | set(PUBLIC_HEADERS_SSE 30 | sse/Matmnt.h 31 | sse/Mat44f.h 32 | sse/Vecnt.h 33 | sse/Vec4f.h 34 | ) 35 | 36 | #neon versions 37 | set(PUBLIC_HEADERS_NEON 38 | neon/Matmnt.h 39 | neon/Mat44f.h 40 | neon/Vecnt.h 41 | neon/Vec4f.h 42 | ) 43 | 44 | source_group(sources FILES ${SOURCES}) 45 | source_group("" FILES ${PUBLIC_HEADERS}) 46 | source_group("sse" FILES ${PUBLIC_HEADERS_SSE}) 47 | source_group("neon" FILES ${PUBLIC_HEADERS_NEON}) 48 | 49 | add_library(DPMath SHARED 50 | ${PUBLIC_HEADERS} 51 | ${PUBLIC_HEADERS_SSE} 52 | ${PUBLIC_HEADERS_NEON} 53 | ${SOURCES} 54 | ) 55 | 56 | if (WIN32) 57 | target_link_libraries( DPMath DPUtil ) 58 | endif() 59 | 60 | set_target_properties( DPMath PROPERTIES FOLDER "DP" ) 61 | -------------------------------------------------------------------------------- /media/dpfx/mdl/mdl_base_checkerBumpTexture.glsl: -------------------------------------------------------------------------------- 1 | vec3 mdl_base_checkerBumpTexture( in _base_textureCoordinateInfo uvw, in float factor, in float blur, in float checkerPosition, in vec3 normal ) 2 | { 3 | const float delta = 0.025f; // magic, looks good with this value 4 | const vec3 black = vec3( 0.0f, 0.0f, 0.0f ); 5 | const vec3 white = vec3( 1.0f, 1.0f, 1.0f ); 6 | 7 | _base_textureCoordinateInfo uvwLocal; 8 | uvwLocal.position = uvw.position + delta * vec3( 0.0f, 0.0f, 0.0f ); 9 | float r0 = mdl_math_luminance( mdl_base_checkerTexture( uvwLocal, black, white, blur, checkerPosition ).tint ); 10 | 11 | uvwLocal.position = uvw.position + delta * uvw.tangentU; 12 | float r1 = mdl_math_luminance( mdl_base_checkerTexture( uvwLocal, black, white, blur, checkerPosition ).tint ); 13 | 14 | uvwLocal.position = uvw.position + delta * uvw.tangentV; 15 | float r2 = mdl_math_luminance( mdl_base_checkerTexture( uvwLocal, black, white, blur, checkerPosition ).tint ); 16 | 17 | uvwLocal.position = uvw.position + delta * normal; 18 | float r3 = mdl_math_luminance( mdl_base_checkerTexture( uvwLocal, black, white, blur, checkerPosition ).tint ); 19 | 20 | return( normalize( normal - ( r1 - r0 ) * uvw.tangentU - ( r2 - r0 ) * uvw.tangentV - ( r3 - r0 ) * normal ) ); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /media/dpfx/mdl/mdl_base_flakeNoiseTexture.glsl: -------------------------------------------------------------------------------- 1 | _base_textureReturn mdl_base_flakeNoiseTexture( in _base_textureCoordinateInfo uvw, in float intensity, in float scale, in float density, int noiseType, float maximumSize, int metric ) 2 | { 3 | vec3 pos = uvw.position / scale; 4 | 5 | float cellDistance = 0.0f; 6 | if ( noiseType == 1 ) 7 | { 8 | worleyReturn ret = worleyNoise( pos, 1.0f, metric ); 9 | cellDistance = ret.val.x; 10 | pos = ret.nearest_pos_0; 11 | } 12 | 13 | vec4 ret2 = miNoise( pos ); 14 | float scal = ret2.w; 15 | 16 | if ( noiseType == 0 ) 17 | { 18 | pos += ret2.xyz * 2.0f; // Displace the coordinate according to noise value 19 | 20 | // Then use only integer coordinates, to make flake transients "harder" and not "wobbly" 21 | scal = miNoise( ivec3( int(floor( pos.x )), int(floor( pos.y )), int(floor( pos.z ) ) ) ).w; 22 | } 23 | 24 | float reflectivity; 25 | if ( ( noiseType == 1 ) && ( maximumSize < cellDistance ) ) 26 | { 27 | reflectivity = 0.0f; 28 | } 29 | else 30 | { 31 | reflectivity = pow( scal, 1.0f / density ) * intensity; 32 | } 33 | 34 | _base_textureReturn tr; 35 | tr.tint = vec3( reflectivity, reflectivity, reflectivity ); 36 | tr.mono = reflectivity; 37 | return( tr ); 38 | } 39 | -------------------------------------------------------------------------------- /media/effects/xml/collada/glsl/colladaCommonBumpmap.glsl: -------------------------------------------------------------------------------- 1 | 2 | vec3 bumpmap( vec3 ns ) 3 | { 4 | if ( 0 <= bumpTC ) 5 | { 6 | // TODO Add parameter support for bumpiness 7 | float bumpiness = 1.0; 8 | 9 | ivec2 texSize = textureSize( bumpSampler, 0 ); 10 | 11 | // Offsets are not transformed on purpose to stay in texel space. 12 | vec2 offset = 1.0 / vec2( texSize.xy ); 13 | 14 | // Central differencing, 15 | vec2 texCoord = evaluateTexCoord( bumpTC ); 16 | float left = texture( bumpSampler, vec2( texCoord.x - offset.x, texCoord.y)).r; 17 | float right = texture( bumpSampler, vec2( texCoord.x + offset.x, texCoord.y)).r; 18 | float bottom = texture( bumpSampler, vec2( texCoord.x, texCoord.y - offset.y)).r; 19 | float top = texture( bumpSampler, vec2( texCoord.x, texCoord.y + offset.y)).r; 20 | 21 | // This resulting vector v.xyz was derived from an expanded cross product. 22 | vec3 v = vec3( left - right, bottom - top, 1.0 ); 23 | v.xy *= bumpiness; // With this a scale of 0.0 eliminates the bump effect! 24 | v = normalize(v); 25 | 26 | return v.x * normalize( varTangent ) + v.y * normalize( varBinormal ) + v.z * ns; 27 | } 28 | else 29 | { 30 | return ns; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /media/dpfx/oitAllResolveCounters_fs.glsl: -------------------------------------------------------------------------------- 1 | // main() of the resolve counters pass of OITAll (right after the depth pass) 2 | 3 | #version 420 4 | 5 | layout(size1x32) uniform restrict uimage1D counterAccu; // 1-element image to count all the samples 6 | layout(size1x32) uniform restrict uimage2D perFragmentCount; // 2D image sized as the view to count the samples per fragment 7 | layout(size1x32) uniform restrict writeonly uimage2D perFragmentOffset; // 2D image sized as the view holding the base offset per fragment 8 | 9 | layout(location = 0, index = 0) out vec4 Color; 10 | 11 | void main() 12 | { 13 | ivec2 screenPos = ivec2( gl_FragCoord.xy ); 14 | 15 | unsigned int count = imageLoad( perFragmentCount, screenPos ).x; 16 | 17 | // if there is at least one sample on this fragment 18 | if ( count != 0 ) 19 | { 20 | unsigned int offset = imageAtomicAdd( counterAccu, 0, count ); // add that count to the counterAcc 21 | imageStore( perFragmentOffset, screenPos, uvec4( offset ) ); // store the resulting offset for this fragment 22 | 23 | imageStore( perFragmentCount, screenPos, uvec4( 0 ) ); // and clear the per-fragment count 24 | } 25 | 26 | Color = vec4( 0 ); // color doesn't matter 27 | } 28 | -------------------------------------------------------------------------------- /test/rix/gl/modules/rix_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | find_package(OpenGL REQUIRED ) 3 | find_package(GLEW REQUIRED) 4 | 5 | FILE (GLOB tests ${linkunit}/*) 6 | 7 | set( LINK_SOURCES "" ) 8 | 9 | add_definitions( 10 | "-D_CRT_SECURE_NO_WARNINGS" 11 | ) 12 | 13 | FOREACH( test ${tests} ) 14 | if( IS_DIRECTORY ${test} ) 15 | if( EXISTS ${test}/CMakeLists.txt ) 16 | string( REGEX REPLACE "^.*/([^/]*)$" "\\1" TEST_NAME ${test} ) 17 | if( NOT (${TEST_NAME} MATCHES "^__") ) 18 | add_subdirectory( ${TEST_NAME} ) 19 | endif() 20 | endif() 21 | endif() 22 | ENDFOREACH( test ${tests} ) 23 | 24 | string( REGEX REPLACE "^.*/([^/]*)$" "\\1" CUR_TEST_MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 25 | 26 | include_directories( 27 | "${GLEW_INCLUDE_DIRS}" 28 | ) 29 | 30 | add_definitions( 31 | "-DCURRENT_MODULE_NAME=\"${CUR_TEST_MODULE_NAME}\"" 32 | "-DCURRENT_MODULE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"" 33 | ) 34 | 35 | add_library( ${LINK_NAME} SHARED 36 | ${LINK_SOURCES} 37 | ) 38 | 39 | target_link_libraries( ${LINK_NAME} 40 | ${GLEW_LIBRARY} 41 | DPTcore 42 | DPUtil 43 | DPTRiX 44 | RiXCore 45 | RiXGL 46 | DPTestManager 47 | DPMath 48 | DPHelpers 49 | DPGL 50 | ) 51 | 52 | add_dependencies( ${LINK_NAME} DPHelpers) -------------------------------------------------------------------------------- /dp/sg/ui/glut/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(GLEW REQUIRED) 2 | find_package(GLUT) 3 | 4 | if (GLUT_FOUND) 5 | #includes 6 | include_directories( 7 | ${GLEW_INCLUDE_DIRS} 8 | ${GLUT_INCLUDE_DIR} 9 | ) 10 | 11 | #definitions 12 | add_definitions( 13 | -DDP_SG_UI_GLUT_EXPORTS 14 | ${GLEW_DEFINITIONS} 15 | ) 16 | 17 | #sources 18 | set(SOURCES 19 | src/SceneRendererWidget.cpp 20 | src/Widget.cpp 21 | ) 22 | 23 | set(PRIVATE_HEADERS 24 | ) 25 | 26 | set(PUBLIC_HEADERS 27 | Config.h 28 | SceneRendererWidget.h 29 | Widget.h 30 | ) 31 | 32 | source_group(source FILES ${SOURCES}) 33 | source_group(header FILES ${PRIVATE_HEADERS}) 34 | source_group("" FILES ${PUBLIC_HEADERS}) 35 | 36 | #target 37 | add_library( DPSgUIGLUT SHARED 38 | ${SOURCES} 39 | ${HEADERS} 40 | ${PUBLIC_HEADERS} 41 | ) 42 | 43 | target_link_libraries( DPSgUIGLUT 44 | DPSgCore 45 | DPGL 46 | ${GLEW_LIBRARY} 47 | ${GLUT_LIBRARIES} 48 | ${OPENGL_gl_LIBRARY} 49 | ) 50 | 51 | CopyGLEW( DPSgUIGLUT "${DP_BINARY_PATH}" ) 52 | CopyGLUT( DPSgUIGLUT "${DP_BINARY_PATH}" ) 53 | 54 | set_target_properties( DPSgUIGLUT PROPERTIES FOLDER "DP/SG/UI" ) 55 | else() 56 | message("GLUT not found, disalbing DpSgUIGLUT.") 57 | endif() -------------------------------------------------------------------------------- /dp/culling/opengl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(DPCullingOpenGL) 2 | 3 | find_package(GLEW REQUIRED ) 4 | 5 | add_definitions( 6 | "-DDP_CULLING_EXPORTS" 7 | "-D_CRT_SECURE_NO_WARNINGS" 8 | ) 9 | 10 | include_directories( ${GLEW_INCLUDE_DIRS} ) 11 | 12 | #definitions 13 | add_definitions( 14 | ${GLEW_DEFINITIONS} 15 | ) 16 | 17 | set(PUBLIC_HEADERS 18 | Manager.h 19 | ) 20 | 21 | set(HEADERS 22 | inc/GroupImpl.h 23 | inc/ManagerImpl.h 24 | ) 25 | 26 | #let cmake determine linker language 27 | set(SOURCES 28 | src/GroupImpl.cpp 29 | src/ManagerImpl.cpp 30 | ) 31 | 32 | source_group(sources FILES ${SOURCES}) 33 | source_group(headers FILES ${HEADERS}) 34 | source_group("" FILES ${PUBLIC_HEADERS}) 35 | 36 | add_library(DPCullingOpenGL STATIC 37 | ${PUBLIC_HEADERS} 38 | ${HEADERS} 39 | ${SOURCES} 40 | ) 41 | 42 | CopyGLEW( DPCullingOpenGL "${DP_BINARY_PATH}" ) 43 | 44 | target_link_libraries( DPCullingOpenGL 45 | DPGL 46 | DPUtil 47 | DPMath 48 | ${OPENGL_gl_LIBRARY} 49 | ${GLEW_LIBRARY} 50 | ) 51 | 52 | set_property(TARGET DPCullingOpenGL PROPERTY LINK_INTERFACE_LIBRARIES "") 53 | 54 | set_target_properties( DPCullingOpenGL PROPERTIES FOLDER "DP/Culling" ) 55 | 56 | if(UNIX) 57 | set_target_properties( DPCullingOpenGL PROPERTIES COMPILE_FLAGS -fPIC ) 58 | endif() 59 | -------------------------------------------------------------------------------- /CMake/FindNVOpenEXR.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find OpenEXR 2 | # Once done this will define 3 | # OPENEXR_FOUND - System has OpenEXR 4 | # OPENEXR_INCLUDE_DIRS - The OpenEXR include directories 5 | # OPENEXR_LIBRARIES - The libraries needed to use OpenEXR 6 | # OPENEXR_DEFINITIONS - Compiler switches required for using OpenEXR 7 | 8 | find_path(OPENEXR_INCLUDE_DIR "Iex.h") 9 | foreach(LIB Iex IlmImf IlmThread Imath Half) 10 | find_library(OPENEXR_${LIB}_LIBRARY_DEBUG NAMES ${LIB} PATH_SUFFIXES "/win32-${DP_ARCH}/lib/Debug") 11 | find_library(OPENEXR_${LIB}_LIBRARY_RELEASE NAMES ${LIB} PATH_SUFFIXES "/win32-${DP_ARCH}/lib/Release") 12 | 13 | list(APPEND OPENEXR_LIBRARIES debug ${OPENEXR_${LIB}_LIBRARY_DEBUG} optimized ${OPENEXR_${LIB}_LIBRARY_RELEASE}) 14 | list(APPEND OPENEXR_LIBRARIES_REQUIRED OPENEXR_${LIB}_LIBRARY_DEBUG OPENEXR_${LIB}_LIBRARY_RELEASE) 15 | endforeach() 16 | 17 | set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE 21 | # if all listed variables are TRUE 22 | find_package_handle_standard_args(OpenEXR DEFAULT_MSG 23 | ${OPENEXR_LIBRARIES_REQUIRED} OPENEXR_INCLUDE_DIR) 24 | 25 | mark_as_advanced(OPENEXR_INCLUDE_DIR ${OPENEXR_LIBRARIES_REQUIRED} ) -------------------------------------------------------------------------------- /media/effects/xml/standard_material/glsl/pntriangles_v3f_n3f_tes.glsl: -------------------------------------------------------------------------------- 1 | 2 | layout( triangles ) in; 3 | 4 | void main() 5 | { 6 | // construct a bezier triangle out of the given triangle, using the normals to calculate the missing vertices 7 | // Note: This calculates the bezierTriangle for each generated vertex. 8 | // Doing that calculation in the TCS (which means: do it per (original) vertex) and 9 | // - pass the 10 bezier points via patch out/in is slightly slower! 10 | // - pass the bezier points as 10 vertices (via layout( vertices = 10 ) out;) is substantially slower! 11 | // Note: copying positions and normals seems to be free 12 | vec3 positions[3], normals[3], bezierPoints[10]; 13 | for ( int i=0 ; i<3 ; i++ ) 14 | { 15 | positions[i] = tcPosition[i]; 16 | normals[i] = tcNormal[i]; 17 | } 18 | createBezierFromPNTriangle( positions, normals, bezierPoints ); 19 | 20 | vec3 normal; 21 | vec3 position = evalBezierTriangle( bezierPoints, gl_TessCoord, normal ); 22 | 23 | vec4 worldPos = sys_WorldMatrix * vec4( position, 1.0f ); 24 | varNormal = ( sys_WorldMatrixIT * vec4( normal, 0.0f ) ).xyz; 25 | varWorldPos = worldPos.xyz; 26 | varEyePos = vec3( sys_ViewMatrixI[3][0], sys_ViewMatrixI[3][1], sys_ViewMatrixI[3][2] ); 27 | gl_Position = sys_ViewProjMatrix * worldPos; 28 | } 29 | -------------------------------------------------------------------------------- /test/rix/gl/modules/gl_feature_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(OpenGL REQUIRED ) 2 | find_package(GLEW REQUIRED) 3 | 4 | FILE (GLOB tests ${linkunit}/*) 5 | 6 | set( LINK_SOURCES "" ) 7 | 8 | add_definitions( 9 | "-D_CRT_SECURE_NO_WARNINGS" 10 | ) 11 | 12 | FOREACH( test ${tests} ) 13 | if( IS_DIRECTORY ${test} ) 14 | if( EXISTS ${test}/CMakeLists.txt ) 15 | string( REGEX REPLACE "^.*/([^/]*)$" "\\1" TEST_NAME ${test} ) 16 | if( NOT (${TEST_NAME} MATCHES "^__") ) 17 | add_subdirectory( ${TEST_NAME} ) 18 | endif() 19 | endif() 20 | endif() 21 | ENDFOREACH( test ${tests} ) 22 | 23 | string( REGEX REPLACE "^.*/([^/]*)$" "\\1" CUR_TEST_MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} ) 24 | 25 | include_directories( 26 | "${GLEW_INCLUDE_DIRS}" 27 | ) 28 | 29 | add_definitions( 30 | "-DCURRENT_MODULE_NAME=\"${CUR_TEST_MODULE_NAME}\"" 31 | "-DCURRENT_MODULE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"" 32 | ${GLEW_DEFINITIONS} 33 | ) 34 | 35 | add_library( ${LINK_NAME} SHARED 36 | ${LINK_SOURCES} 37 | ) 38 | 39 | add_dependencies( ${LINK_NAME} DPTestManager DPHelpers ) 40 | 41 | target_link_libraries( ${LINK_NAME} 42 | ${GLEW_LIBRARY} 43 | DPTcore 44 | DPUtil 45 | DPTRiX 46 | RiXCore 47 | RiXGL 48 | DPTestManager 49 | DPMath 50 | DPHelpers 51 | DPGL 52 | ) 53 | 54 | -------------------------------------------------------------------------------- /media/dpfx/mdl/mdl_base_tileTexture.glsl: -------------------------------------------------------------------------------- 1 | _base_textureReturn mdl_base_tileTexture( in _base_textureCoordinateInfo uvw, in vec3 tileColor, in vec3 groutColor, in float numberOfRows 2 | , in float numberOfColumns, in float groutWidth, in float groutHeight, in float groutRoughness 3 | , in float missingTileAmount, in float tileBrightnessVariation, in float seed, in int specialRowIndex 4 | , in float specialRowWidthFactor, in int specialColumnIndex, in float specialColumnHeightFactor 5 | , in float oddRowOffset, in float randomRowOffset ) 6 | { 7 | vec2 numColsRows = vec2( numberOfColumns, numberOfRows ); 8 | ivec2 specialColRowIndex = ivec2( specialColumnIndex, specialRowIndex ); 9 | vec2 specialColRowSizeFactor = vec2( specialColumnHeightFactor, specialRowWidthFactor ); 10 | vec2 groutSize = vec2( groutWidth, groutHeight ); 11 | int r = evalTileFunction( uvw.position.xy, numColsRows, specialColRowIndex, specialColRowSizeFactor, oddRowOffset, randomRowOffset 12 | , seed, missingTileAmount, groutSize, groutRoughness, tileBrightnessVariation, tileColor, true ); 13 | 14 | _base_textureReturn tr; 15 | tr.tint = ( r != 0 ) ? tileColor : groutColor; 16 | tr.mono = 0.0f; 17 | return( tr ); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /media/dpfx/mdl/evalEnvironmentMap.glsl: -------------------------------------------------------------------------------- 1 | vec3 evalEnvironmentMap( in vec3 R, in float roughness ) 2 | { 3 | // convert R to 2D 4 | vec2 tc = vec2( ( atan( R.x, -R.z ) + PI ) / ( 2.0f * PI ), acos( -R.y ) / PI ); 5 | 6 | // Due to discontinuity of atan2 at PI and -PI, standard texture sampling 7 | // produces a seam of pixels sampled from the lowest mip level because 8 | // dFdx and dFdy of the latitude are artificially high. To remedy this we 9 | // approximate the magnitude of the derivative of latitude analytically 10 | // and use our own gradients. 11 | 12 | // Compute dx and dy 13 | // The 2*PI factor transforms from a derivative in radians to a derivative in texture space. 14 | vec2 dx = vec2( length( dFdx( R.xy ) ) / ( 2 * PI ), dFdx( tc.y ) ); 15 | vec2 dy = vec2( length( dFdy( R.xy ) ) / ( 2 * PI ), dFdy( tc.y ) ); 16 | 17 | // determine the corresponding lod level 18 | ivec2 envMapSize = textureSize( sys_EnvironmentSampler, 0 ); 19 | vec2 lodMapSize = envMapSize * max( dx, dy ); 20 | float lodLevel = log2( max( lodMapSize.x, lodMapSize.y ) ); 21 | 22 | // determine the maximal lod level 23 | float maxLevel = log2( max( envMapSize.x, envMapSize.y ) ); 24 | 25 | // mix lodLevel and maxLevel with roughness 26 | float roughLevel = mix( lodLevel, maxLevel, roughness ); 27 | 28 | return( textureLod( sys_EnvironmentSampler, tc, roughLevel ).rgb ); 29 | } 30 | -------------------------------------------------------------------------------- /media/effects/xml/environment.xml: -------------------------------------------------------------------------------- 1 | 2 |