Compare commits
199 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
312f640a4a | ||
|
|
2b0105f875 | ||
|
|
b0c89b137d | ||
|
|
b2daa32420 | ||
|
|
bf208e1d10 | ||
|
|
24d61c2df0 | ||
|
|
e6f6de640a | ||
|
|
00679c7631 | ||
|
|
4e126469fc | ||
|
|
ccbc632afc | ||
|
|
060a641c2b | ||
|
|
cd124228fd | ||
|
|
4ad34877d2 | ||
|
|
2a8b760833 | ||
|
|
8dea265a91 | ||
|
|
7ec8b65ec4 | ||
|
|
c6c49c3745 | ||
|
|
acac960227 | ||
|
|
da6b4df00a | ||
|
|
7f370bdfc6 | ||
|
|
587fd6a022 | ||
|
|
730e6ad8f5 | ||
|
|
a8017cb807 | ||
|
|
ac6b082963 | ||
|
|
61957024fc | ||
|
|
117fd42efc | ||
|
|
387e66911b | ||
|
|
dc9f6f2751 | ||
|
|
8a4cdcf264 | ||
|
|
02d91a3eea | ||
|
|
59f417f1e0 | ||
|
|
9ad7ae5524 | ||
|
|
0c7fda710c | ||
|
|
cbf5b14f61 | ||
|
|
2e33cf0abc | ||
|
|
361ea5d15d | ||
|
|
a3b2ac63b3 | ||
|
|
3f9ab5689c | ||
|
|
af5a794a82 | ||
|
|
faa2b1d964 | ||
|
|
ab95a79540 | ||
|
|
079cf6c090 | ||
|
|
7dbcb4b7d3 | ||
|
|
634bd7f12d | ||
|
|
384cc25380 | ||
|
|
b43a59aa5d | ||
|
|
e135a85c1a | ||
|
|
2f914506e9 | ||
|
|
e5c951f5a3 | ||
|
|
9566fb7acf | ||
|
|
511f7be394 | ||
|
|
56e2a03378 | ||
|
|
5fc917881d | ||
|
|
00e2930fb7 | ||
|
|
fe9c235806 | ||
|
|
8d505e80a9 | ||
|
|
b6cb11b655 | ||
|
|
4b6d9287bc | ||
|
|
b41c5bde96 | ||
|
|
2ac97b5ece | ||
|
|
21c0affe66 | ||
|
|
68fc6ca610 | ||
|
|
52edc4af8d | ||
|
|
c1757aadb4 | ||
|
|
cfd190a9fa | ||
|
|
5311d6fb6b | ||
|
|
e31afbf78a | ||
|
|
be6bc39016 | ||
|
|
38727ed4b4 | ||
|
|
8491fd780d | ||
|
|
3ccdc66717 | ||
|
|
2f71c55da9 | ||
|
|
7b6135f0f7 | ||
|
|
05e896af7e | ||
|
|
33bf30cd8c | ||
|
|
fd014e3b52 | ||
|
|
3f0c1daaa2 | ||
|
|
c9fc6e0f79 | ||
|
|
348fbfe410 | ||
|
|
47ec2c7951 | ||
|
|
6ea8ebf25a | ||
|
|
2b65555d5f | ||
|
|
2439679b0c | ||
|
|
0cbf839425 | ||
|
|
82cae6daf4 | ||
|
|
6767ff540b | ||
|
|
69ebfecfcc | ||
|
|
3834172342 | ||
|
|
036bb7b472 | ||
|
|
b5dff94107 | ||
|
|
1784381dc7 | ||
|
|
9e18a7542b | ||
|
|
1c6fd4da9b | ||
|
|
e1b3c78013 | ||
|
|
f263ad29db | ||
|
|
dd32ee2945 | ||
|
|
0b5cb65cdd | ||
|
|
a8e78fde99 | ||
|
|
43b274f65c | ||
|
|
f97ea3577d | ||
|
|
9726617b6e | ||
|
|
997276d359 | ||
|
|
dceb353fe6 | ||
|
|
d8600411bd | ||
|
|
066c272f7a | ||
|
|
7ebe56291f | ||
|
|
c89a7fe67c | ||
|
|
b14bb21801 | ||
|
|
37eae8c719 | ||
|
|
12b298130a | ||
|
|
c548289ac1 | ||
|
|
2ebde09aff | ||
|
|
049f88325a | ||
|
|
cc68d7f151 | ||
|
|
5770774e00 | ||
|
|
5624a22fe4 | ||
|
|
9905b90a18 | ||
|
|
6d5c6ad6cc | ||
|
|
971eba37ad | ||
|
|
43574b52c1 | ||
|
|
625c771641 | ||
|
|
1504a54cd8 | ||
|
|
0f2e9e6557 | ||
|
|
cd150cbe96 | ||
|
|
02d7d980a7 | ||
|
|
c8521068a5 | ||
|
|
832d8d5228 | ||
|
|
bdd0be2f8f | ||
|
|
968a427e00 | ||
|
|
b8f9249bea | ||
|
|
e2fb88e187 | ||
|
|
749dc86dd3 | ||
|
|
84bae01643 | ||
|
|
8a5d1b9f44 | ||
|
|
488b4854b2 | ||
|
|
6455159757 | ||
|
|
2e68db5b55 | ||
|
|
2e29085669 | ||
|
|
f223fec92d | ||
|
|
cc3cb92ddc | ||
|
|
4dcb2bbf3c | ||
|
|
eeb13d1efc | ||
|
|
fe98c3d7f5 | ||
|
|
46b07141e8 | ||
|
|
02bfd05d6f | ||
|
|
035abfdb71 | ||
|
|
0c99326db3 | ||
|
|
8103da6ef1 | ||
|
|
bd83044c08 | ||
|
|
f6b64afdfc | ||
|
|
1c65815f4e | ||
|
|
5e9be10da6 | ||
|
|
820532ddff | ||
|
|
6951c44464 | ||
|
|
e12049ed47 | ||
|
|
fd47b84bd7 | ||
|
|
b7947b13f3 | ||
|
|
7a601753e0 | ||
|
|
07e5480b57 | ||
|
|
ea1e832d4d | ||
|
|
da7bf3ff81 | ||
|
|
a6fbf73f36 | ||
|
|
ef8fd268de | ||
|
|
064c39a7f3 | ||
|
|
5eb9ab1d75 | ||
|
|
e8ba57b22f | ||
|
|
47aa320787 | ||
|
|
3a3ddfce49 | ||
|
|
dc2aa77d98 | ||
|
|
aa6cd2d7da | ||
|
|
658fd4d19d | ||
|
|
8b4359b77e | ||
|
|
c5d00bc223 | ||
|
|
1eedae844e | ||
|
|
e819ea9c0e | ||
|
|
15b9a493ed | ||
|
|
0341d6f873 | ||
|
|
3577fd9d90 | ||
|
|
a47294a580 | ||
|
|
452802b168 | ||
|
|
5a3f2e287c | ||
|
|
bf5a88870f | ||
|
|
8af46a6e98 | ||
|
|
56617a4bfb | ||
|
|
7eaceb0baa | ||
|
|
8feae585e1 | ||
|
|
fa7843d520 | ||
|
|
d48a304569 | ||
|
|
ce90a9b2da | ||
|
|
273dd046c2 | ||
|
|
627c3df093 | ||
|
|
ab372b9ead | ||
|
|
247eee2ca1 | ||
|
|
d4bbec4a0c | ||
|
|
114c818f2e | ||
|
|
1ee6d476f8 | ||
|
|
8a29c504e4 | ||
|
|
f376af1fd5 | ||
|
|
e663330bdf |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -6,6 +6,10 @@ doc/openthreads.doxyfile
|
||||
|
||||
doc/OpenSceneGraphReferenceDocs/
|
||||
doc/OpenThreadsReferenceDocs/
|
||||
doc/*.chm
|
||||
|
||||
CMakeDoxyfile.in
|
||||
CMakeDoxygenDefaults.cmake
|
||||
|
||||
cmake_uninstall.cmake
|
||||
|
||||
@@ -59,6 +63,10 @@ install_manifest*.txt
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# Automatically generated Package files
|
||||
packaging/cmake/*
|
||||
configure/*
|
||||
|
||||
# Platform Specifics - auto generated files
|
||||
PlatformSpecifics/Windows/*.rc
|
||||
|
||||
@@ -79,6 +87,9 @@ PlatformSpecifics/Windows/*.rc
|
||||
*.sdf
|
||||
*.opensdf
|
||||
|
||||
# Visual Studio - Cache/Options Directory
|
||||
.vs/
|
||||
|
||||
#osx xcode
|
||||
DerivedData/
|
||||
*.DS_Store
|
||||
|
||||
@@ -15,8 +15,8 @@ matrix:
|
||||
dist: trusty
|
||||
language: cpp
|
||||
env:
|
||||
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
|
||||
#- LLVM_VERSION=3.8
|
||||
sudo: false
|
||||
cache:
|
||||
|
||||
47
AUTHORS.txt
47
AUTHORS.txt
@@ -1,6 +1,6 @@
|
||||
OpenSceneGraph Library 3.6.3
|
||||
OpenSceneGraph Library 3.6.4
|
||||
|
||||
569 Contributors:
|
||||
570 Contributors:
|
||||
|
||||
Firstname Surname
|
||||
-----------------
|
||||
@@ -10,10 +10,10 @@ Stephan Huber
|
||||
Paul Martz
|
||||
Laurens Voerman
|
||||
Farshid Lashkari
|
||||
Mathias Frhlich
|
||||
Mathias Fr<EFBFBD>hlich
|
||||
Marco Jez
|
||||
Wang Rui
|
||||
Jean-Sbastien Guay
|
||||
Jean-S<EFBFBD>bastien Guay
|
||||
Ulrich Hertlein
|
||||
Mike Weiblen
|
||||
Sukender
|
||||
@@ -43,8 +43,8 @@ Chris Hanson
|
||||
Roland Smeenk
|
||||
Roger James
|
||||
Jeremy Moles
|
||||
J.P. Delport
|
||||
Andy Skinner
|
||||
J.P. Delport
|
||||
Magnus Kessler
|
||||
David Fries
|
||||
Tom Jolley
|
||||
@@ -67,11 +67,11 @@ Norman Vine
|
||||
Chris Denham
|
||||
Sherman Wilcox
|
||||
Serge Lages
|
||||
Romano Jos Magacho da Silva
|
||||
Romano Jos<EFBFBD> Magacho da Silva
|
||||
Mourad Boufarguine
|
||||
Alberto Farre
|
||||
Glenn Waldron
|
||||
Andr Garneau
|
||||
Andr<EFBFBD> Garneau
|
||||
Adrian Egli
|
||||
Sebastian Messerschmidt
|
||||
Randall Hopper
|
||||
@@ -86,7 +86,7 @@ Michael Gronager
|
||||
Martin Naylor
|
||||
Joakim Simonsson
|
||||
David Spilling
|
||||
Daniel Sjlie
|
||||
Daniel Sj<EFBFBD>lie
|
||||
Bryan Thrall
|
||||
Andreas Ekstrand
|
||||
Rafa Gaitan
|
||||
@@ -123,7 +123,7 @@ Gordon Tomlinson
|
||||
Frederic Marmond
|
||||
Frederic Bouvier
|
||||
Carlo Camporesi
|
||||
Bjrn Blissing
|
||||
Bj<EFBFBD>rn Blissing
|
||||
Alexander Sinditskiy
|
||||
Vladimir Chebaev
|
||||
Thibault Genessay
|
||||
@@ -143,7 +143,7 @@ Uwe Woessner
|
||||
Tony Horrobin
|
||||
Thom DeCarlo
|
||||
Tatsuhiro Nishioka
|
||||
Tanguy Fautr
|
||||
Tanguy Fautr<EFBFBD>
|
||||
Sean Spicer
|
||||
Ryan Kawicki
|
||||
Richard Schmidt
|
||||
@@ -202,7 +202,7 @@ Phil Atkin
|
||||
Pawel Ksiezopolski
|
||||
Patrick Neary
|
||||
Nathan Monteleone
|
||||
Miha Ravelj
|
||||
Miha Rav<EFBFBD>elj
|
||||
Miguel Escriva
|
||||
Mattias Linde
|
||||
Mark Sciabica
|
||||
@@ -232,10 +232,11 @@ Dietmar Funck
|
||||
Colin Cochran
|
||||
Christian Ruzicka
|
||||
Christian Buchner
|
||||
Chris Djali
|
||||
Charles Cole
|
||||
Blake Williams
|
||||
Bjrn Hein
|
||||
Aurlien Chatelain
|
||||
Bj<EFBFBD>rn Hein
|
||||
Aur<EFBFBD>lien Chatelain
|
||||
Antoine Hue
|
||||
Andrew Bettison
|
||||
Andreas Henne
|
||||
@@ -264,7 +265,7 @@ Paul Obermeier
|
||||
Nguyen Van Truong
|
||||
Nathan Cournia
|
||||
Morten Haukness
|
||||
Morn Pistorius
|
||||
Morn<EFBFBD> Pistorius
|
||||
Michael Mc Donnell
|
||||
Michael Henheffer
|
||||
Michael Guerrero
|
||||
@@ -297,7 +298,7 @@ Guillaume Taze
|
||||
Guillaume Chouvenc
|
||||
Giuseppe Donvito
|
||||
Gill Peacegood
|
||||
Giampaolo Vigan
|
||||
Giampaolo Vigan<EFBFBD>
|
||||
Gerrick Bivins
|
||||
George Tarantilis
|
||||
Ferdi Smit
|
||||
@@ -305,7 +306,7 @@ Eduardo Poyart
|
||||
Edgar Ellis
|
||||
Dmitry Marakasov
|
||||
Dimi Christopoulos
|
||||
Diane Delalle
|
||||
Diane Delall<EFBFBD>e
|
||||
David Longest
|
||||
David Ergo
|
||||
Daniel Trstenjak
|
||||
@@ -337,7 +338,7 @@ Vasily Radostev
|
||||
Valery Bickov
|
||||
Valeriy Dubov
|
||||
Vaclav Bilek
|
||||
Tyge Lvset
|
||||
Tyge L<EFBFBD>vset
|
||||
Troy Yee
|
||||
Torben Dannahauer
|
||||
Tony Vasile
|
||||
@@ -387,7 +388,7 @@ Piotr Rak
|
||||
Pierre Bourdin
|
||||
Philipp Svehla
|
||||
Philipp Siemoleit
|
||||
Philipp Mchler
|
||||
Philipp M<EFBFBD>chler
|
||||
Philip Lamb
|
||||
Petr Salinger
|
||||
Peter Bear
|
||||
@@ -412,7 +413,7 @@ Nick Thu
|
||||
Nick Black
|
||||
Mojtaba Fathi
|
||||
Mirko Viviani
|
||||
Mikkel Gjl
|
||||
Mikkel Gj<EFBFBD>l
|
||||
Mike Krus
|
||||
Mike Garrity
|
||||
Mick Thu
|
||||
@@ -465,7 +466,7 @@ Juan Hernando
|
||||
Josh Portway
|
||||
Jonathan Greig
|
||||
John Tan
|
||||
John Hedstrm
|
||||
John Hedström
|
||||
John Grant
|
||||
John Farrier
|
||||
John Donovan
|
||||
@@ -523,11 +524,11 @@ David Jung
|
||||
Danny Valente
|
||||
Daniel Stien
|
||||
Dan Minor
|
||||
Csar L. B. Silveira
|
||||
C<EFBFBD>sar L. B. Silveira
|
||||
Cyril Brulebois
|
||||
Curtis Rubel
|
||||
Cory Slep
|
||||
Clment Bsch
|
||||
Cl<EFBFBD>ment B<EFBFBD>sch
|
||||
Clay Fowler
|
||||
Claus Steuer
|
||||
Chuck Sembroski
|
||||
@@ -539,8 +540,8 @@ Christian Kaser
|
||||
Christian Ehrlicher
|
||||
Chris White
|
||||
Chris McGlone
|
||||
Chris Djali
|
||||
Carlos Garcea
|
||||
Capostrophic
|
||||
Bryce Eldridge
|
||||
Bruno Herbelin
|
||||
Brian Keener
|
||||
|
||||
243
CMakeLists.txt
243
CMakeLists.txt
@@ -3,13 +3,13 @@
|
||||
#
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 158)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 4)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 160)
|
||||
|
||||
|
||||
# set to 0 when not a release candidate, non zero means that any generated
|
||||
# git tags will be treated as release candidates of given number
|
||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
|
||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 9)
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
@@ -41,6 +41,8 @@ IF(APPLE)
|
||||
OSG_OSX_VERSION "${OSG_OSX_VERSION}")
|
||||
ENDIF()
|
||||
|
||||
PROJECT(OpenSceneGraph)
|
||||
|
||||
# Set OSX architecture flags here, since they must be specified before
|
||||
# creating the actual OSG project.
|
||||
# Note that the CMAKE_OSX_* variables are not well documented in
|
||||
@@ -48,67 +50,73 @@ ENDIF()
|
||||
# See https://cmake.org/Bug/view.php?id=14695#c34953
|
||||
# Additionally, OSG_WINDOWING_SYSTEM is set here for OSX since its
|
||||
# value is needed to find the correct version of OpenGL (X11 or Cocoa).
|
||||
IF(APPLE AND NOT ANDROID)
|
||||
|
||||
# Here we check if the user specified IPhone SDK
|
||||
# These options are formally defined later, but can also be specified
|
||||
# by the user at the command line using the cmake -D switch
|
||||
# Note that FORCE is used since the user will likely enable IPhone
|
||||
# build via CMake GUI after already having configured once
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS.")
|
||||
IF(ANDROID)
|
||||
SET(OSG_WINDOWING_SYSTEM "None" CACHE STRING "Windowing system type for graphics window creation; options: None.")
|
||||
ELSEIF(WIN32 OR MINGW)
|
||||
SET(OSG_WINDOWING_SYSTEM "Win32" CACHE STRING "Windowing system type for graphics window creation; options: Win32 or None.")
|
||||
ELSEIF(APPLE)
|
||||
# custom option to flag an iOS build
|
||||
OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF)
|
||||
|
||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
ELSE()
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
ENDIF()
|
||||
|
||||
# set sdk and min versions
|
||||
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
|
||||
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
||||
|
||||
# get full path to sdk from requested versions
|
||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
|
||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
|
||||
|
||||
# optionally enable bitcode for the build
|
||||
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
|
||||
|
||||
# seamless toggle between device and simulator
|
||||
SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
|
||||
|
||||
# set deployment target to min version
|
||||
SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Deployment target for iOS" FORCE)
|
||||
|
||||
# Set standard architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
|
||||
|
||||
ELSE()
|
||||
#simulator uses i386 and x86_64 architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
||||
ENDIF()
|
||||
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
||||
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
||||
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
||||
ELSE()
|
||||
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
||||
ENDIF()
|
||||
|
||||
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two separate projects
|
||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||
|
||||
ELSE()
|
||||
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
||||
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
||||
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
|
||||
ELSE()
|
||||
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
|
||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
||||
# These are set the first time CMake is run, and can be changed by
|
||||
# the user at any time.
|
||||
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
|
||||
# 64 Bit Works, i386,ppc is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
|
||||
# 64 Bit Works, PPC is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
ELSE()
|
||||
# No Universal Binary support and SDK detection is too unreliable.
|
||||
# Warn user and continue at their own peril.
|
||||
MESSAGE(WARNING "OSX 10.3 and earlier not supported.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
|
||||
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
|
||||
# These are set the first time CMake is run, and can be changed by
|
||||
# the user at any time.
|
||||
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
|
||||
# 64 Bit Works, i386,ppc is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
|
||||
# 64 Bit Works, PPC is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version")
|
||||
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4)
|
||||
# 64-bit compiles are not supported with Carbon.
|
||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
|
||||
ELSE()
|
||||
# No Universal Binary support and SDK detection is too unreliable.
|
||||
# Warn user and continue at their own peril.
|
||||
MESSAGE(WARNING "OSX 10.3 and earlier not supported.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
|
||||
ENDIF()
|
||||
|
||||
PROJECT(OpenSceneGraph)
|
||||
|
||||
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||
|
||||
@@ -218,40 +226,15 @@ ENDIF(OSG_MAINTAINER)
|
||||
|
||||
IF(NOT ANDROID)
|
||||
IF(APPLE)
|
||||
# Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working
|
||||
# Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below
|
||||
# set to true. Should really have an OSG_BUILD_PLATFORM variable that we set to our desired platform
|
||||
OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF)
|
||||
OPTION(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR "Enable IPhoneSDK Simulator support" OFF)
|
||||
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
|
||||
#you need to manually set the default sdk version here
|
||||
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
|
||||
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
||||
# set the sdk path as our sysroot, if we set this before the project is defined cmake fails to build its test program
|
||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||
|
||||
#the below is taken from ogre, it states the gcc stuff needs to happen before PROJECT() is called. I've no clue if we even need it
|
||||
# Force gcc <= 4.2 on iPhone
|
||||
IF(IPHONE_VERSION_MIN LESS "6.0")
|
||||
include(CMakeForceCompiler)
|
||||
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
||||
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
|
||||
SET(GCC_THUMB_SUPPORT NO)
|
||||
ENDIF()
|
||||
# Set the path to OpenGL library
|
||||
SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework")
|
||||
|
||||
#set either the device sdk or the simulator sdk. Can't find away to separate these in the same project
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
|
||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
|
||||
ELSE()
|
||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer")
|
||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneSimulator${IPHONE_SDKVER}.sdk")
|
||||
ENDIF()
|
||||
|
||||
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
|
||||
|
||||
# Apple iOS: Find OpenGLES
|
||||
FIND_LIBRARY(OPENGLES_LIBRARY OpenGLES)
|
||||
ELSE ()
|
||||
FIND_LIBRARY(CARBON_LIBRARY Carbon)
|
||||
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
||||
@@ -454,6 +437,9 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE)
|
||||
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
|
||||
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
|
||||
|
||||
OPTION(OSG_USE_FLOAT_QUAT "Set to ON to build OpenSceneGraph with float Quat instead of double." OFF)
|
||||
MARK_AS_ADVANCED(OSG_USE_FLOAT_QUAT)
|
||||
|
||||
IF (WIN32)
|
||||
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
|
||||
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
|
||||
@@ -515,6 +501,12 @@ ENDIF()
|
||||
|
||||
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
|
||||
|
||||
IF (OSG_BUILD_PLATFORM_IPHONE OR ANDROID)
|
||||
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to ON to enable attempt to use FontConfig in osgText." OFF)
|
||||
ELSE ()
|
||||
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to OFF to disable attempt to use FontConfig in osgText." ON)
|
||||
ENDIF ()
|
||||
|
||||
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
|
||||
IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE)
|
||||
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
|
||||
@@ -542,12 +534,12 @@ ELSE()
|
||||
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
|
||||
ENDIF()
|
||||
|
||||
SET(OSG_GL_CONTEXT_VERSION "1.0" CACHE STRING "GL Context String to pass when creaing graphics contexts")
|
||||
|
||||
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
|
||||
SET(DEFAULT_GL_CONTEXT_VERSION "1.0")
|
||||
IF (OSG_GL3_AVAILABLE)
|
||||
|
||||
SET(OSG_GL_CONTEXT_VERSION "3.3")
|
||||
SET(DEFAULT_GL_CONTEXT_VERSION "3.3")
|
||||
|
||||
IF (APPLE)
|
||||
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
||||
@@ -600,6 +592,8 @@ ELSE()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(OSG_GL_CONTEXT_VERSION ${DEFAULT_GL_CONTEXT_VERSION} CACHE STRING "GL Context String to pass when creaing graphics contexts")
|
||||
|
||||
IF (OSG_GL1_AVAILABLE)
|
||||
SET(OSG_GL1_FEATURES 1)
|
||||
ELSE()
|
||||
@@ -752,7 +746,6 @@ ELSE()
|
||||
FIND_PACKAGE(COLLADA)
|
||||
FIND_PACKAGE(FBX)
|
||||
FIND_PACKAGE(ZLIB)
|
||||
FIND_PACKAGE(OpenVRML)
|
||||
FIND_PACKAGE(GDAL)
|
||||
FIND_PACKAGE(GTA)
|
||||
FIND_PACKAGE(CURL)
|
||||
@@ -798,9 +791,7 @@ IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||
|
||||
FIND_PACKAGE(FLTK)
|
||||
FIND_PACKAGE(FOX)
|
||||
|
||||
SET(wxWidgets_USE_LIBS base core gl net)
|
||||
FIND_PACKAGE(wxWidgets)
|
||||
FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
|
||||
|
||||
ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||
|
||||
@@ -891,10 +882,26 @@ IF(CYGWIN)
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
|
||||
MARK_AS_ADVANCED(LIB_POSTFIX)
|
||||
# Set OSG_INSTALL_LIBDIR to specify the installation directories of object code libraries
|
||||
IF(DEFINED LIB_POSTFIX)
|
||||
# Use LIB_POSTFIX if defined
|
||||
SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
|
||||
ELSE()
|
||||
IF(CMAKE_VERSION VERSION_LESS "2.8.5")
|
||||
IF(UNIX AND NOT WIN32 AND NOT APPLE)
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
|
||||
MARK_AS_ADVANCED(LIB_POSTFIX)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(NOT DEFINED LIB_POSTFIX)
|
||||
SET(LIB_POSTFIX "")
|
||||
ENDIF()
|
||||
SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
|
||||
ELSE()
|
||||
# Use the GNU standard installation directories for CMake >= 2.8.5
|
||||
INCLUDE(GNUInstallDirs)
|
||||
SET(OSG_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(NOT DEFINED LIB_POSTFIX)
|
||||
@@ -1105,41 +1112,15 @@ ENDIF()
|
||||
|
||||
IF(APPLE AND NOT ANDROID)
|
||||
|
||||
#Here we check if the user specified IPhone SDK
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
|
||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ELSE()
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ENDIF()
|
||||
# set osg window system to iOS
|
||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS." FORCE)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
||||
|
||||
ELSE()
|
||||
#simulator uses i386 and x86_64 architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
||||
|
||||
ENDIF()
|
||||
|
||||
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two separate projects
|
||||
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
|
||||
|
||||
#hack, force link to opengles
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework OpenGLES")
|
||||
|
||||
#use the IPhone windowing system
|
||||
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Forced IPhone windowing system on iOS" FORCE)
|
||||
# set osg default image plugin
|
||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE)
|
||||
|
||||
#I think this or similar will be required for IPhone apps
|
||||
# ensure app bundles for example app
|
||||
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" ON)
|
||||
|
||||
ELSE()
|
||||
@@ -1365,6 +1346,13 @@ IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||
ENDIF()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# add clobber build target to clear all the non git registered files/directories
|
||||
#-----------------------------------------------------------------------------
|
||||
add_custom_target(clobber
|
||||
COMMAND git clean -d -f -x
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
### uninstall target
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -1376,4 +1364,5 @@ ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
#
|
||||
|
||||
include(FeatureSummary)
|
||||
feature_summary(WHAT ALL)
|
||||
|
||||
@@ -25,11 +25,14 @@ ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
SET(COLLADA_BUILDNAME "mac")
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
ELSEIF(MINGW)
|
||||
SET(COLLADA_BUILDNAME "mingw")
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
ELSEIF(MSVC_VERSION EQUAL 1900 OR MSVC_VERSION EQUAL 1910 )
|
||||
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
|
||||
ELSEIF((MSVC_VERSION GREATER 1910) OR (MSVC_VERSION EQUAL 1910))
|
||||
SET(COLLADA_BUILDNAME "vc14")
|
||||
SET(COLLADA_BOOST_BUILDNAME "vc141")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1900)
|
||||
SET(COLLADA_BUILDNAME "vc14")
|
||||
SET(COLLADA_BOOST_BUILDNAME "vc140")
|
||||
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||
|
||||
@@ -60,6 +60,9 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
||||
|
||||
SET( FBX_SEARCH_PATHS
|
||||
$ENV{FBX_DIR}
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
|
||||
"/Applications/Autodesk/FBX\ SDK/2019.0"
|
||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
|
||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
|
||||
"/Applications/Autodesk/FBX\ SDK/2018.0"
|
||||
|
||||
101
CMakeModules/FindFontconfig.cmake
Normal file
101
CMakeModules/FindFontconfig.cmake
Normal file
@@ -0,0 +1,101 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindFontconfig
|
||||
--------------
|
||||
|
||||
Find Fontconfig headers and library.
|
||||
|
||||
Imported Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
``Fontconfig::Fontconfig``
|
||||
The Fontconfig library, if found.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This will define the following variables in your project:
|
||||
|
||||
``FONTCONFIG_FOUND``
|
||||
true if (the requested version of) Fontconfig is available.
|
||||
``FONTCONFIG_VERSION``
|
||||
the version of Fontconfig.
|
||||
``FONTCONFIG_LIBRARIES``
|
||||
the libraries to link against to use Fontconfig.
|
||||
``FONTCONFIG_INCLUDE_DIRS``
|
||||
where to find the Fontconfig headers.
|
||||
``FONTCONFIG_COMPILE_OPTIONS``
|
||||
this should be passed to target_compile_options(), if the
|
||||
target is not used for linking
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig)
|
||||
set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER})
|
||||
set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION})
|
||||
|
||||
find_path( FONTCONFIG_INCLUDE_DIR
|
||||
NAMES
|
||||
fontconfig/fontconfig.h
|
||||
HINTS
|
||||
${PKG_FONTCONFIG_INCLUDE_DIRS}
|
||||
/usr/X11/include
|
||||
)
|
||||
|
||||
find_library( FONTCONFIG_LIBRARY
|
||||
NAMES
|
||||
fontconfig
|
||||
PATHS
|
||||
${PKG_FONTCONFIG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION)
|
||||
file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$")
|
||||
unset(FONTCONFIG_VERSION)
|
||||
foreach(VPART MAJOR MINOR REVISION)
|
||||
foreach(VLINE ${_contents})
|
||||
if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$")
|
||||
set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}")
|
||||
if(FONTCONFIG_VERSION)
|
||||
string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}")
|
||||
else()
|
||||
set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Fontconfig
|
||||
FOUND_VAR
|
||||
FONTCONFIG_FOUND
|
||||
REQUIRED_VARS
|
||||
FONTCONFIG_LIBRARY
|
||||
FONTCONFIG_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
FONTCONFIG_VERSION
|
||||
)
|
||||
|
||||
|
||||
if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig)
|
||||
add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED)
|
||||
set_target_properties(Fontconfig::Fontconfig PROPERTIES
|
||||
IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)
|
||||
|
||||
if(FONTCONFIG_FOUND)
|
||||
set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY})
|
||||
set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
|
||||
endif()
|
||||
@@ -225,7 +225,7 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
|
||||
IF(APPLE)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
@@ -336,7 +336,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
@@ -429,7 +429,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
840
ChangeLog
840
ChangeLog
@@ -1,3 +1,843 @@
|
||||
Thu, 25 Jul 2019 14:58:17 +0100
|
||||
Author : Robert Osfield
|
||||
Changed the #extension enable
|
||||
|
||||
Thu, 25 Jul 2019 14:10:01 +0100
|
||||
Author : Robert Osfield
|
||||
Change the DefaultFont so that it's managemed via the ObjectCache to enabl it to be release and cleared in a central manner. Added call to Registry::releaseGLObjects() to osgViewer/Renderer.cpp to enable automatic clean up of objects in the ObjectCache.
|
||||
|
||||
Thu, 25 Jul 2019 12:48:21 +0100
|
||||
Author : Robert Osfield
|
||||
Added readObject() implementations
|
||||
|
||||
Thu, 25 Jul 2019 10:39:34 +0100
|
||||
Author : Robert Osfield
|
||||
Added ReaderWriterOBJ::readObject(..) implementations to address issue with using osgconv
|
||||
|
||||
Mon, 22 Jul 2019 19:22:16 +0100
|
||||
Author : Robert Osfield
|
||||
Updates for 3.6.4-rc8
|
||||
|
||||
Mon, 22 Jul 2019 17:20:10 +0100
|
||||
Author : Robert Osfield
|
||||
Added handling of iOS and Android to make sure FontConfig is only used for Desktop builds
|
||||
|
||||
Fri, 19 Jul 2019 09:20:50 +0100
|
||||
Author : Robert Osfield
|
||||
Updated for rc7
|
||||
|
||||
Fri, 19 Jul 2019 09:10:02 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #797 from wangii/OpenSceneGraph-3.6 fix u64 and i64 allocation, setArray bug
|
||||
|
||||
Fri, 19 Jul 2019 14:06:20 +0800
|
||||
Author : Linan Wang
|
||||
fix typo
|
||||
|
||||
Fri, 19 Jul 2019 13:28:25 +0800
|
||||
Author : Linan Wang
|
||||
fix u64 and i64 allocation, setArray bug
|
||||
|
||||
Thu, 18 Jul 2019 12:44:59 +0100
|
||||
Author : Robert Osfield
|
||||
Fixed indentation
|
||||
|
||||
Thu, 18 Jul 2019 09:13:25 +0800
|
||||
Author : Long Huan
|
||||
Add OutputTextureFiles OptionAdd OutputTextureFiles Option support Write out the texture images to file
|
||||
|
||||
|
||||
Wed, 17 Jul 2019 15:07:38 +0800
|
||||
Author : Long Huan
|
||||
Update OBJWriterNodeVisitor.cpp
|
||||
|
||||
Wed, 17 Jul 2019 14:52:10 +0800
|
||||
Author : Long Huan
|
||||
fix obj-Plugin export texture fileFix obj-plugin to support export texture file
|
||||
|
||||
|
||||
Thu, 18 Jul 2019 12:18:04 +0100
|
||||
Author : Robert Osfield
|
||||
Added handling of zero radius models
|
||||
|
||||
Thu, 18 Jul 2019 11:16:08 +0100
|
||||
Author : Robert Osfield
|
||||
Removed references OpenVRML plugin
|
||||
|
||||
Thu, 18 Jul 2019 11:14:10 +0100
|
||||
Author : Robert Osfield
|
||||
Removed vrml plugin from build as OpenVRML plugin relies on no longer supported functionality
|
||||
|
||||
Thu, 18 Jul 2019 10:34:53 +0100
|
||||
Author : Robert Osfield
|
||||
Added calls to curl_global_init and curl_global_cleanup to improve the robustness of threaded curl plugin usage
|
||||
|
||||
Tue, 16 Jul 2019 13:50:02 +0100
|
||||
Author : Robert Osfield
|
||||
Updated for rc6
|
||||
|
||||
Tue, 16 Jul 2019 11:53:24 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #789 from rhabacker/OpenSceneGraph-3.6cmake: Add find_package module for fontconfig
|
||||
|
||||
Tue, 16 Jul 2019 11:32:10 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #791 from aluaces/mingw-osg_windowing_systemAvoid that mingw cross-compilation choosing X11 as the windowing system.
|
||||
|
||||
Tue, 16 Jul 2019 11:08:25 +0200
|
||||
Author : Alberto Luaces
|
||||
Avoid that mingw cross-compilation choosing X11 as the windowing system.I have moved the PROJECT stanza before the conditionals, because
|
||||
otherwise expressions like IF(MINGW) always fail.
|
||||
|
||||
|
||||
Mon, 15 Jul 2019 18:54:30 +0200
|
||||
Author : Ralf Habacker
|
||||
cmake: Add summary information to get an idea of what dependencies might be missing
|
||||
|
||||
Mon, 15 Jul 2019 18:52:14 +0200
|
||||
Author : Ralf Habacker
|
||||
cmake: Added find_package module for fontconfig which is not available with cmake < 3.14This file has been taken from cmake 3.14
|
||||
|
||||
|
||||
Mon, 15 Jul 2019 17:06:51 +0100
|
||||
Author : Robert Osfield
|
||||
Updated for 3.6.4-rc5
|
||||
|
||||
Mon, 15 Jul 2019 16:16:45 +0100
|
||||
Author : Robert Osfield
|
||||
Adopted the matrix transformation code from Text
|
||||
|
||||
Mon, 15 Jul 2019 16:13:57 +0100
|
||||
Author : Robert Osfield
|
||||
Added test of picking
|
||||
|
||||
Mon, 15 Jul 2019 15:05:05 +0100
|
||||
Author : Robert Osfield
|
||||
Cuietened down the reporting of failure to find fontconfig
|
||||
|
||||
Mon, 15 Jul 2019 14:11:11 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #788 from rhabacker/3.6-obj-plugin-fixes3.6 obj plugin fixes
|
||||
|
||||
Tue, 16 Jan 2018 10:23:36 +0100
|
||||
Author : Ralf Habacker
|
||||
obj plugin: Fix bug not adding first vertex index on writing GL_LINExxx array types
|
||||
|
||||
Mon, 15 Jan 2018 14:22:18 +0100
|
||||
Author : Ralf Habacker
|
||||
obj plugin: Fix not writing material shininess
|
||||
|
||||
Mon, 15 Jul 2019 14:29:26 +0200
|
||||
Author : Ralf Habacker
|
||||
obj plugin: add option "NsIfNotPresent=" for setting the specular exponent of a material if not present
|
||||
|
||||
Mon, 25 Sep 2017 13:59:13 +0200
|
||||
Author : Ralf Habacker
|
||||
obj plugin: Fix bug not using specular color (Ks) for illumination mode > 2See paragraph "Illumination models" at http://paulbourke.net/dataformats/mtl/ for details.
|
||||
|
||||
|
||||
Mon, 15 Jul 2019 11:14:47 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #786 from rhabacker/OpenSceneGraph-3.6Fix 'Incorrect default location for true type fonts on openSUSE'
|
||||
|
||||
Tue, 2 Jul 2019 22:56:02 +0200
|
||||
Author : Ralf Habacker
|
||||
Fix 'Incorrect default location for true type fonts on openSUSE'https://github.com/openscenegraph/OpenSceneGraph/issues/778
|
||||
|
||||
|
||||
Fri, 12 Jul 2019 17:00:20 +0100
|
||||
Author : Robert Osfield
|
||||
Added check against any empty _segments to avoid undefined behaviour
|
||||
|
||||
Fri, 12 Jul 2019 16:16:43 +0100
|
||||
Author : Robert Osfield
|
||||
Removed debug info for constructor and destructors
|
||||
|
||||
Fri, 12 Jul 2019 16:09:12 +0100
|
||||
Author : Robert Osfield
|
||||
Added FrameBufferAttachment::resizeGLObjectBuffers(..) and releaseGLObjects(..) methods
|
||||
|
||||
Tue, 2 Jul 2019 20:37:02 +0200
|
||||
Author : StefanBruens
|
||||
Fix wxWidgets COMPONENTS specification, deprecated usage broken with CMake 3.14Current FindWxWidgets.cmake allows to specify OPTIONAL components, unfortunately
|
||||
this broke the (deprecated) use of wxWidgets_USE_LIBS.
|
||||
|
||||
Fixes: #779
|
||||
|
||||
Tue, 2 Jul 2019 20:21:45 +0100
|
||||
Author : Robert Osfield
|
||||
Updated ChangeLog for rc4
|
||||
|
||||
Tue, 2 Jul 2019 20:21:05 +0100
|
||||
Author : Robert Osfield
|
||||
Updated SO number to refect change to the Drawable header inline method status
|
||||
|
||||
Tue, 2 Jul 2019 20:19:05 +0100
|
||||
Author : Robert Osfield
|
||||
Updated in prep for 3.6.4-rc4
|
||||
|
||||
Mon, 1 Jul 2019 16:15:21 +0100
|
||||
Author : Colin McDonald
|
||||
Trivial change to src/osgSim/LineOfSight.cpp to quieten down an info message in DatabaseCacheReadCallback::readNodeFile.
|
||||
|
||||
Mon, 1 Jul 2019 16:12:53 +0100
|
||||
Author : Robert Osfield
|
||||
Updated release candidate number to 4 in prep for 3.6.4-rc4 release.
|
||||
|
||||
Mon, 1 Jul 2019 15:48:29 +0100
|
||||
Author : Robert Osfield
|
||||
Removed stray tab
|
||||
|
||||
Tue, 25 Jun 2019 17:09:46 +1200
|
||||
Author : jimcamel
|
||||
Fixed bug where FFmpeg Image Stream would stop if paused for more than 10 secondsThe FFmpeg image stream class uses a 10 second timeout between frames to determine if the stream is dead and if so closes it. However, the timeout is determined using the variable lastUpdateTS which stores the last time the publishNewFrame function was called, and if the video has been playing and then is paused for longer than 10 seconds, when it is unpaused this timeout will fire and the stream will be closed, stopping the video playing beyond what has been buffered.
|
||||
|
||||
To stop this timeout from happening before the video starts playing, the timeout checks to see if the lastUpdateTS > 0 (at initialization it is set to 0). In this fix, we simply set the value of lastUpdateTS to 0 when the video is unpaused, this will force the check to skip on unpause, and from then on lastUpdateTS will have the correct value again.
|
||||
|
||||
The lastUpdateTS variable is private and only used for this one function, so there should be no side effects from the change.
|
||||
|
||||
Fri, 7 Jun 2019 12:45:45 +0200
|
||||
Author : Riccardo Corsi
|
||||
Bugfix due to copy-paste typo which prevented multi uv channel mesh to be imported correctly.
|
||||
|
||||
Mon, 1 Jul 2019 13:43:29 +0100
|
||||
Author : Robert Osfield
|
||||
Fixed layout
|
||||
|
||||
Mon, 1 Jul 2019 13:42:33 +0100
|
||||
Author : Robert Osfield
|
||||
Merge branch 'patch-27' of https://github.com/mp3butcher/OpenSceneGraph into patch-27
|
||||
|
||||
Thu, 30 May 2019 23:10:27 +0300
|
||||
Author : Alexey Galitsyn
|
||||
Fix not checking num lock state when remapping keypad keys on Windows.Num lock state was never checked during remapping keypad keys on Windows.
|
||||
Now when num lock is active, keypad numeric keys and keypad delimeter key
|
||||
should work as expected (return KEY_KP_0 to KEY_KP_9 and KEY_KP_Decimal
|
||||
respectivly).
|
||||
|
||||
|
||||
Mon, 1 Jul 2019 12:56:36 +0100
|
||||
Author : Robert Osfield
|
||||
Restructed the setting of the default osgDB::Options so it doesn't override the ObjectCacheHint setting when a user specified osgDB::Options object is passed in.
|
||||
|
||||
Mon, 1 Jul 2019 12:33:21 +0100
|
||||
Author : Robert Osfield
|
||||
Merge branch 'OpenSceneGraph-3.6_vas' of https://github.com/eligovision/OpenSceneGraph into OpenSceneGraph-3.6_vas
|
||||
|
||||
Mon, 1 Jul 2019 12:18:21 +0100
|
||||
Author : Robert Osfield
|
||||
Couldn't resolve warnings coming from the FBX headers so had to suppress warnings.
|
||||
|
||||
Tue, 21 May 2019 13:28:41 +0200
|
||||
Author : Laurens Voerman
|
||||
replaced "if (apm || !apm->valid())"
|
||||
|
||||
Tue, 21 May 2019 13:29:47 +0200
|
||||
Author : Laurens Voerman
|
||||
fix typo in header guard.
|
||||
|
||||
Wed, 15 May 2019 11:49:17 +0200
|
||||
Author : Laurens Voerman
|
||||
fix typo in ReaderWriterFBX: writObject -> writeObject
|
||||
|
||||
Fri, 14 Jun 2019 15:28:46 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #760 from LaurensVoerman/readObjectimplement readObject for all relevant readerWriters
|
||||
|
||||
Fri, 14 Jun 2019 15:01:15 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #759 from AnyOldName3/more-tgaVarious TGA improvements
|
||||
|
||||
Fri, 14 Jun 2019 14:32:31 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #758 from LaurensVoerman/osgt_indentationfix indentation for osgt files for windows dynamic library build.
|
||||
|
||||
Fri, 14 Jun 2019 14:29:32 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #757 from LaurensVoerman/rendererNoRefCountfix compile error if OSGUTIL_RENDERBACKEND_USE_REF_PTR not defined in include/osgUtil/RenderLeaf
|
||||
|
||||
Sat, 8 Jun 2019 01:17:21 +0200
|
||||
Author : Julien Valentin
|
||||
update traversedebug preventing traversal to disable OQN
|
||||
|
||||
Fri, 31 May 2019 15:27:18 +0200
|
||||
Author : Julien Valentin
|
||||
add enable check in traverseQuery
|
||||
|
||||
Wed, 15 May 2019 14:35:39 +0300
|
||||
Author : Konstantin S. Matveyev
|
||||
typo fix
|
||||
|
||||
Wed, 15 May 2019 14:27:10 +0300
|
||||
Author : valid-ptr
|
||||
VertexArrayState's lazy disabling of vertex attributes mechanism major fix: _vertexAttribArrays must be 'shared'
|
||||
|
||||
Tue, 14 May 2019 14:25:30 +0200
|
||||
Author : Laurens Voerman
|
||||
implement readObject for all relevant readerWriters
|
||||
|
||||
Mon, 13 May 2019 21:56:07 +0100
|
||||
Author : AnyOldName3
|
||||
Add support for Targa type 3 and 11 images (greyscale)
|
||||
|
||||
Mon, 13 May 2019 17:25:29 +0200
|
||||
Author : Laurens Voerman
|
||||
fix indentation for osgt files for windows dynamic library build.
|
||||
|
||||
Mon, 13 May 2019 17:02:53 +0200
|
||||
Author : Laurens Voerman
|
||||
fix compile error if OSGUTIL_RENDERBACKEND_USE_REF_PTR not defined in include/osgUtil/RenderLeaf
|
||||
|
||||
Sat, 11 May 2019 00:00:41 +0100
|
||||
Author : AnyOldName3
|
||||
Avoid wasting memory loading optional TGA fields as RLE image data
|
||||
|
||||
Fri, 10 May 2019 00:04:49 +0100
|
||||
Author : AnyOldName3
|
||||
Add support for type 9 (colour mapped, compressed) TGA images.
|
||||
|
||||
Fri, 10 May 2019 00:04:08 +0100
|
||||
Author : AnyOldName3
|
||||
Check TGA footer if present to see if attribute channel contains alpha data
|
||||
|
||||
Wed, 8 May 2019 10:17:06 +0100
|
||||
Author : Robert Osfield
|
||||
Merged ELSEIF fix from master
|
||||
|
||||
Tue, 30 Apr 2019 11:03:02 +0200
|
||||
Author : Laurens Voerman
|
||||
add missing E to ELSIF# Conflicts:
|
||||
# src/osgViewer/CMakeLists.txt
|
||||
|
||||
|
||||
Wed, 8 May 2019 00:59:40 +0100
|
||||
Author : AnyOldName3
|
||||
Consistently check for failed memory allocation
|
||||
|
||||
Wed, 8 May 2019 00:56:42 +0100
|
||||
Author : AnyOldName3
|
||||
Switch to using safe buffers (fixing a memory leak)
|
||||
|
||||
Sat, 4 May 2019 01:19:31 +0100
|
||||
Author : AnyOldName3
|
||||
Cleanup TGA header interpretation* Read the colour map `First Entry Index` field. If non-zero, error out as the format specification is vague as to what it does and different readers interpret it differently.
|
||||
* Rename the variable that holds the colour map entry size as the existing name could be misinterpreted as the size of the pointer, not the thing pointed to.
|
||||
* Handle images reporting themselves as 15 bits per pixel in the same way as Truevision's example code.
|
||||
|
||||
|
||||
Fri, 26 Apr 2019 10:46:04 +0100
|
||||
Author : Robert Osfield
|
||||
Fixed indentation
|
||||
|
||||
Fri, 19 Apr 2019 13:04:35 +0800
|
||||
Author : Wei Lisi
|
||||
remove tabs
|
||||
|
||||
Fri, 5 Apr 2019 14:31:21 -0700
|
||||
Author : flashk
|
||||
Update fbxRMesh.cpp
|
||||
|
||||
Tue, 26 Mar 2019 22:37:50 +0800
|
||||
Author : Wei Lisi
|
||||
clean up
|
||||
|
||||
Tue, 26 Mar 2019 21:01:24 +0800
|
||||
Author : Wei Lisi
|
||||
fix fbx hierarchy issue
|
||||
|
||||
Wed, 28 Nov 2018 14:21:37 -0600
|
||||
Author : Derek Quam
|
||||
Fix two bugs introduced when removing the Geode visitor from the FBX exporter.In the Geometry visitor, use getNodePath to check if the Geometry node
|
||||
is root instead of getNumParents.
|
||||
|
||||
Reset the state inside buildFaces to prevent duplication when a
|
||||
Group is inside of Group.
|
||||
|
||||
|
||||
Tue, 13 Nov 2018 08:47:06 -0600
|
||||
Author : Derek Quam
|
||||
Fix duplicate geometries in FBX export.The fix to allow the export of orphaned Geometry nodes accidentally
|
||||
duplicated those geometry nodes in 'normal' scene trees. This commit
|
||||
refactors the code to rely on the visitor to traverse the Geometry as
|
||||
opposed to traversing the Geometry in the Geode visit and the Geometry
|
||||
visit.
|
||||
|
||||
|
||||
Fri, 26 Apr 2019 09:36:51 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #745 from eligovision/OpenSceneGraph-3.6_cmake CMake: OSG_WINDOWING_SYSTEM fixed
|
||||
|
||||
Sun, 14 Apr 2019 00:47:36 +0300
|
||||
Author : Konstantin S. Matveyev
|
||||
CMake: Win32 option added to OSG_WINDOWING_SYSTEM
|
||||
|
||||
Sun, 14 Apr 2019 00:04:11 +0300
|
||||
Author : valid-ptr
|
||||
CMake: OSG_WINDOWING_SYSTEM fixed; FORCE flag removed
|
||||
|
||||
Fri, 12 Apr 2019 13:57:35 +0100
|
||||
Author : Robert Osfield
|
||||
cMerge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6
|
||||
|
||||
Fri, 12 Apr 2019 13:55:39 +0100
|
||||
Author : Robert Osfield
|
||||
Added ability to set which tree rendering techniques to build (via --featuers bitmask command line) and output scene to using -o outputfilename.extension command line.
|
||||
|
||||
Thu, 11 Apr 2019 12:42:22 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #737 from eligovision/OpenSceneGraph-3.6_androidosgDB::DynamicLibrary: local lib loading on Android fixed
|
||||
|
||||
Fri, 29 Mar 2019 16:25:43 +0300
|
||||
Author : Konstantin S. Matveyev
|
||||
osgDB::DynamicLibrary: local lib loading on Android fixed
|
||||
|
||||
Tue, 26 Mar 2019 06:52:09 +0100
|
||||
Author : Jeongseok Lee
|
||||
Update CMakeModules/FindCOLLADA.cmakeKeeping old style operator to align with OSG CMake 2.8.0 support.
|
||||
|
||||
Co-Authored-By: eknabe <44489094+eknabe@users.noreply.github.com>
|
||||
|
||||
|
||||
Mon, 25 Mar 2019 14:09:04 +0000
|
||||
Author : Robert Osfield
|
||||
Added basic load and compile stats collection enabled by --stats command line.
|
||||
|
||||
Mon, 25 Mar 2019 12:42:28 +0000
|
||||
Author : Robert Osfield
|
||||
Added a call to the CullSetting::readCommnadLine(..) to make sure the --NO_CULLING and --VIEW_FRUSTUM, --VIEW_FRUSTUM_SIDES command line parameters are honoured
|
||||
|
||||
Mon, 25 Mar 2019 12:40:41 +0000
|
||||
Author : Robert Osfield
|
||||
Added --NO_CULLING, --VIEW_FRSUTUM and --VIEW_FRUSTUM_SIDES/--vfs command line options for setting the Camera CullingMode value
|
||||
|
||||
Wed, 20 Mar 2019 09:09:56 -0700
|
||||
Author : Jeongseok Lee
|
||||
Update comments and fix cmake version check
|
||||
|
||||
Tue, 19 Mar 2019 14:33:42 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #727 from ccochran/OpenSceneGraph-3.6Fixes Android build for osgViewer.
|
||||
|
||||
Mon, 18 Mar 2019 08:55:05 -0600
|
||||
Author : Colin Cochran
|
||||
Fixes osgViewer CMake build for Android.Adds FORCE to overwrite the cached OWG_WINDOWING_SYSTEM variable.
|
||||
|
||||
|
||||
Sat, 16 Mar 2019 11:59:28 -0600
|
||||
Author : Colin Cochran
|
||||
Fixes Android build for osgViewer.Previously, cmake attempted to build cocoa windowing system source even if MAKE_SYSTEM_NAME was set to ANDROID.
|
||||
|
||||
|
||||
Fri, 15 Mar 2019 15:46:58 +0300
|
||||
Author : Capostrophic
|
||||
Replace redundant asCullVisitor usage with a type check
|
||||
|
||||
Sat, 16 Mar 2019 11:30:21 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #726 from Capostrophic/linearinterpolatorOverride default behavior for linear vector interpolations
|
||||
|
||||
Fri, 15 Mar 2019 21:29:13 +0300
|
||||
Author : Capostrophic
|
||||
Override default behavior for linear vector interpolations
|
||||
|
||||
Tue, 26 Feb 2019 17:19:06 +0000
|
||||
Author : Chris Djali
|
||||
Resolve OpenGL error caused by confusion between geometry shader implementations.There are two types of Geometry Shaders in OpenGL. One is provided by `GL_EXT_geometry_shader4` and `GL_ARB_geometry_shader4` and requires that certain parameters are set with calls to `glProgramParameteri` before the program is linked. The other is provided by OpenGL 3.2 as a core feature and by the GLES extensions `GL_EXT_geometry_shader` and `GL_OES_geometry_shader` and requires these parameters to be set in the GLSL source itself.
|
||||
|
||||
The value of `isGeometryShader4Supported` is being used to determine if the `glProgramParameteri` calls should occur, so it should only be `true` when one of the extensions requiring them is present.
|
||||
|
||||
Tue, 5 Mar 2019 09:32:55 -0800
|
||||
Author : flashk
|
||||
Update StackedTransform.cpp
|
||||
|
||||
Sun, 10 Mar 2019 15:43:48 +0300
|
||||
Author : Capostrophic
|
||||
Avoid unnecessary matrix type conversion in osgParticle
|
||||
|
||||
Thu, 14 Mar 2019 10:13:15 +0000
|
||||
Author : Robert Osfield
|
||||
Removed the optional code path hack
|
||||
|
||||
Wed, 13 Mar 2019 20:05:12 +0300
|
||||
Author : Capostrophic
|
||||
Add OSG_USE_FLOAT_QUAT build option to use single precision quaternions
|
||||
|
||||
Thu, 14 Mar 2019 09:39:40 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #724 from AnyOldName3/more-gitignoreAdd missing files to .gitignore
|
||||
|
||||
Wed, 13 Mar 2019 23:13:41 +0000
|
||||
Author : AnyOldName3
|
||||
Add Visual Studio cache/options directory to .gitignore
|
||||
|
||||
Wed, 13 Mar 2019 23:13:00 +0000
|
||||
Author : AnyOldName3
|
||||
Add missing documentation build files to .gitignore
|
||||
|
||||
Mon, 25 Feb 2019 15:06:54 +0000
|
||||
Author : Robert Osfield
|
||||
Streamline the animation path completion message
|
||||
|
||||
Tue, 29 Jan 2019 14:40:16 +0100
|
||||
Author : Daniel Trstenjak
|
||||
OcclusionQueryNode: reset the test result of the invalid geometryThere're cases that the occlusion test result has been retrieved
|
||||
after the query geometry has been changed, it's the result of the
|
||||
geometry before the change.
|
||||
|
||||
|
||||
Tue, 29 Jan 2019 11:37:28 +0100
|
||||
Author : Daniel Trstenjak
|
||||
OcclusionQueryNode: ensure a valid query geometryIf the query geometry is invalid then don't do any occlusion queries and
|
||||
never traverse the subgraphs.
|
||||
|
||||
|
||||
Mon, 4 Feb 2019 14:46:42 +0100
|
||||
Author : Björn Blissing
|
||||
Add search location for textures in FBX pluginThe FBX plugin may fail texture lookup even if the texture is located in
|
||||
the same folder as the model file. This change tries, as a last resort,
|
||||
to check if the texture filename is available in the same folder as the
|
||||
model.
|
||||
|
||||
|
||||
Wed, 20 Feb 2019 16:54:23 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #704 from mp3butcher/patch-24uncomment INLINE_DRAWABLE_DRAW
|
||||
|
||||
Wed, 20 Feb 2019 16:31:58 +0000
|
||||
Author : Robert Osfield
|
||||
Added override for broken bindings
|
||||
|
||||
Mon, 28 Jan 2019 01:40:35 +0100
|
||||
Author : Julien Valentin
|
||||
uncomment INLINE_DRAWABLE_DRAW
|
||||
|
||||
Sat, 26 Jan 2019 19:36:30 +0000
|
||||
Author : Robert Osfield
|
||||
Updates for 3.6.4-rc3
|
||||
|
||||
Sat, 26 Jan 2019 18:21:47 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #702 from mp3butcher/fix36add MeshReindexation flag
|
||||
|
||||
Sat, 26 Jan 2019 18:10:44 +0000
|
||||
Author : Robert Osfield
|
||||
Added missing {} to fix getPassed() bug introducted by previus commit
|
||||
|
||||
Fri, 25 Jan 2019 15:02:45 +0100
|
||||
Author : Daniel Trstenjak
|
||||
OcclusionQueryNode: ensure a consistent value for '_passed'
|
||||
|
||||
Sat, 26 Jan 2019 16:33:23 +0000
|
||||
Author : Robert Osfield
|
||||
Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels().
|
||||
|
||||
Wed, 23 Jan 2019 12:10:00 +0100
|
||||
Author : Daniel Trstenjak
|
||||
OcclusionQueryNode: add resetting of queriesIf there's a big view change then it might not be appropriate to wait
|
||||
for '_queryFrameCount' till the next query is issued, because then
|
||||
geometry might pop into the view after '_queryFrameCount'.
|
||||
|
||||
This is especially important for applications not having a constant
|
||||
frame rate, but just issue a new frame on demand.
|
||||
|
||||
|
||||
Wed, 23 Jan 2019 17:06:04 +0100
|
||||
Author : mp3butcher
|
||||
fix variable name
|
||||
|
||||
Fri, 17 Aug 2018 09:22:40 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Changed member variable name to be consistent with header
|
||||
|
||||
Fri, 17 Aug 2018 09:21:31 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Changed the member variable to be consistent with the method name.
|
||||
|
||||
Thu, 16 Aug 2018 00:18:24 +0200
|
||||
Author : mp3butcher
|
||||
add a bool parameter to allow forced reindexation of a mesh
|
||||
|
||||
Wed, 23 Jan 2019 15:40:13 +0000
|
||||
Author : Robert Osfield
|
||||
Commented out the reset of the _vertexArrayObject = 0 as it was break later State::resetCurrentVertexArrayStateOnMatch() calls ability to reset the State::_currentVAO when required.
|
||||
|
||||
Wed, 23 Jan 2019 08:52:11 +0000
|
||||
Author : Robert Osfield
|
||||
Fixed typo
|
||||
|
||||
Tue, 22 Jan 2019 20:21:56 +0000
|
||||
Author : Robert Osfield
|
||||
Added separate test and rest of _currentVAO to State::resetCurrentVertexArrayStateOnMatch(..) method
|
||||
|
||||
Mon, 21 Jan 2019 18:13:43 +0000
|
||||
Author : Robert Osfield
|
||||
Changed resetCurrentVertexArrayStateOnMatch() to reset _vas tp _globalVertexArrayState and currentVAO to 0.
|
||||
|
||||
Mon, 21 Jan 2019 17:36:40 +0000
|
||||
Author : Robert Osfield
|
||||
Added reset of the State::CurrentVertexArrayState() to prevent the State::_vas becoming a dangling pointer when VertexArrayState objects are deleted.
|
||||
|
||||
Sat, 19 Jan 2019 16:16:53 +0000
|
||||
Author : Robert Osfield
|
||||
Added calling of releaseGLObjects() and resizeGLObjects() to the Camera DrawCallback's to enable the draw callbacks to clean up their own GL objects.
|
||||
|
||||
Thu, 17 Jan 2019 17:24:22 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #693 from LaurensVoerman/glObj_C4250fix MSVC warning C4250: inherits 'X' via dominance (94x)
|
||||
|
||||
Thu, 17 Jan 2019 16:22:51 +0100
|
||||
Author : Laurens Voerman
|
||||
fix MSVC warning C4250: inherits 'X' via dominance (94x)
|
||||
|
||||
Mon, 14 Jan 2019 11:55:24 +0000
|
||||
Author : Robert Osfield
|
||||
Added derpecated and thread unsafe warning message to docs of ObjectCache::getgetFromObjectCache()
|
||||
|
||||
Mon, 14 Jan 2019 10:23:05 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #691 from LaurensVoerman/clrObjCacheclear temp objectCache in databaseRequest
|
||||
|
||||
Mon, 14 Jan 2019 09:55:00 +0000
|
||||
Author : Robert Osfield
|
||||
Added using to quieten VS warnings
|
||||
|
||||
Mon, 14 Jan 2019 10:19:41 +0100
|
||||
Author : Laurens Voerman
|
||||
clear temp objectCache in databaseRequest
|
||||
|
||||
Sat, 12 Jan 2019 11:27:18 +0000
|
||||
Author : Robert Osfield
|
||||
Moved resizeGLObjects/releaseGLObjects out of Referenced to avoid multiple inheritance warnings
|
||||
|
||||
Thu, 10 Jan 2019 09:45:32 +0000
|
||||
Author : Robert Osfield
|
||||
Added read/writeObject() entry point to FBX plugin.
|
||||
|
||||
Wed, 9 Jan 2019 10:22:54 +0000
|
||||
Author : Robert Osfield
|
||||
Upated ChangeLog
|
||||
|
||||
Wed, 9 Jan 2019 10:19:34 +0000
|
||||
Author : Robert Osfield
|
||||
Updated for 3.6.4-rc2
|
||||
|
||||
Wed, 9 Jan 2019 08:51:29 +0000
|
||||
Author : Robert Osfield
|
||||
Added cmake package configuration files to gitignore
|
||||
|
||||
Wed, 9 Jan 2019 08:43:08 +0000
|
||||
Author : Robert Osfield
|
||||
Replaced use of heap with use of stack created ifstream to avoid potential memory leak
|
||||
|
||||
Wed, 9 Jan 2019 08:38:16 +0000
|
||||
Author : Robert Osfield
|
||||
Introduced use of ref_ptr<> and private destructor to tighen up memory management and avoid users attempting to inappropriately delete TexCoordRange.
|
||||
|
||||
Tue, 8 Jan 2019 19:32:50 +0000
|
||||
Author : Robert Osfield
|
||||
Fixed for crashes on exit associaciated with VAO usage and vairous niche usage cases
|
||||
|
||||
Mon, 7 Jan 2019 17:46:02 +0000
|
||||
Author : Robert Osfield
|
||||
Fixed crash on exit issues with osgFX, osgParticle, osgSim and the osgforest example
|
||||
|
||||
Mon, 7 Jan 2019 10:25:13 +0000
|
||||
Author : Robert Osfield
|
||||
Merged changes from master
|
||||
|
||||
Fri, 4 Jan 2019 09:22:12 +0000
|
||||
Author : Robert Osfield
|
||||
Updated rc number for 3.6.4 release candidate
|
||||
|
||||
Fri, 4 Jan 2019 09:10:39 +0000
|
||||
Author : Robert Osfield
|
||||
Updated ChangeLog and AUTHORS in prep for 3.6.4 work
|
||||
|
||||
Fri, 4 Jan 2019 08:10:15 +0000
|
||||
Author : Robert Osfield
|
||||
Added use of sizeof to make code a bit more flexible
|
||||
|
||||
Fri, 4 Jan 2019 08:08:07 +0000
|
||||
Author : Robert Osfield
|
||||
Restructured the clean up of arrays/primitives and GL objects
|
||||
|
||||
Mon, 31 Dec 2018 11:06:45 +0000
|
||||
Author : Robert Osfield
|
||||
Changed the clean up of the GL objects on destruction so that the destructors of the arrays/primitives themselves do the release rather than have it done explictly in the destructor. This allows arrays/primitives to be shared.
|
||||
|
||||
Thu, 20 Dec 2018 08:46:12 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #679 from mp3butcher/patch-18setup camera Read/Draw Buffer
|
||||
|
||||
Wed, 19 Dec 2018 18:30:26 +0100
|
||||
Author : Julien Valentin
|
||||
setup camera Read/Draw Bufferfix flickering shadows in SingleThread
|
||||
|
||||
Fri, 14 Dec 2018 09:14:26 +0000
|
||||
Author : Robert Osfield
|
||||
Removed examples from build as it was causing travis to timeout
|
||||
|
||||
Thu, 13 Dec 2018 14:06:51 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Fixed indentation
|
||||
|
||||
Thu, 13 Dec 2018 08:31:27 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #671 from mp3butcher/patch-16remove useless code
|
||||
|
||||
Thu, 13 Dec 2018 08:01:24 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #672 from ccochran/OpenSceneGraph-3.6Xcode 9/10 build fixes for OSG 3.6
|
||||
|
||||
Tue, 11 Dec 2018 23:56:47 +0100
|
||||
Author : Julien Valentin
|
||||
remove dead code
|
||||
|
||||
Mon, 23 Jul 2018 23:52:16 +0100
|
||||
Author : Thomas Hogarth
|
||||
removed ios simulator reference, adjusted readme
|
||||
|
||||
Tue, 10 Jul 2018 02:09:28 +0100
|
||||
Author : Thomas Hogarth
|
||||
Improved iOS cmake support for xcode 9.4 and cmake 3.11
|
||||
|
||||
Fri, 7 Dec 2018 14:53:52 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #670 from emminizer/four-byte-utf8osgText::String:createUTF8EncodedString() now supports 4-byte UTF-8 strings (code points over 0x100000)
|
||||
|
||||
Thu, 6 Dec 2018 14:07:55 -0500
|
||||
Author : Daniel Emminizer
|
||||
osgText::String:createUTF8EncodedString() now supports 4-byte UTF-8 strings (code points over 0x100000).
|
||||
|
||||
Tue, 20 Nov 2018 16:12:21 -0800
|
||||
Author : flashk
|
||||
Prefer FOURCC pixel format in DDS loaderI have found that certain image editing programs export DDS images with both the DDPF_FOURCC and DDPF_RGB pixel format flags. The DDS loader will give preference to the DDPF_RGB flag and try to deduce the format from the RGB bit mask values instead of using the more reliable FOURCC flag. This causes some images to not load, even though the FOURCC flag is supported. I've modified the loader so that it checks for the DDPF_FOURCC flag first, then falls back on deducing the format from the RGB bit masks.
|
||||
|
||||
Tue, 20 Nov 2018 14:24:24 +0000
|
||||
Author : Robert Osfield
|
||||
Added, currently commented out, alias for .vsga and .vsgb to help with automatic loading a vsg plugin when .vsga and .vsgb files are encountered.
|
||||
|
||||
Tue, 20 Nov 2018 14:19:37 +0000
|
||||
Author : Robert Osfield
|
||||
Added support for reading and writing images
|
||||
|
||||
Sun, 11 Nov 2018 10:14:50 +0000
|
||||
Author : Robert Osfield
|
||||
Restructed the setting of the OSG_GL_CONTEXT_VERSION to allow script to set it's default value
|
||||
|
||||
Fri, 9 Nov 2018 11:28:57 +0000
|
||||
Author : Robert Osfield
|
||||
Added make clobber target, imported in from the VSG project.
|
||||
|
||||
Fri, 9 Nov 2018 11:25:16 +0000
|
||||
Author : Robert Osfield
|
||||
Removed 12 year old workaround that is no longer required and was causing a misleading info message "OpenGL extension '' is not supported." to be reported.
|
||||
|
||||
Fri, 2 Nov 2018 08:34:43 +0000
|
||||
Author : OpenSceneGraph git repository
|
||||
Replaced tabs with spaces to fix indentation
|
||||
|
||||
Thu, 1 Nov 2018 10:49:40 -0700
|
||||
Author : flashk
|
||||
Fix handling of alpha values in animated gifsThe gif loader was incorrectly setting pixels as transparent in certain animated gifs. It was ignoring the disposal method value in the extension block and always overwriting the alpha value in each frame. It is common for some animated gifs to set the disposal method so that the previous alpha value is retained. This patch modifies the loader to respect the disposal method flag.
|
||||
|
||||
Thu, 1 Nov 2018 09:13:43 +0000
|
||||
Author : Robert Osfield
|
||||
Removed reprecated C++ usage
|
||||
|
||||
Mon, 29 Oct 2018 07:22:50 +0100
|
||||
Author : Emil Knabe
|
||||
Added support for FBX 2019
|
||||
|
||||
Tue, 23 Oct 2018 08:44:55 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #649 from LaurensVoerman/3.6-dae3.6 dae
|
||||
|
||||
Fri, 12 Oct 2018 13:25:13 -0700
|
||||
Author : flashk
|
||||
Update daeRMaterials.cpp
|
||||
|
||||
Fri, 12 Oct 2018 13:23:23 -0700
|
||||
Author : flashk
|
||||
Update daeReader.h
|
||||
|
||||
Wed, 17 Oct 2018 15:55:10 +0100
|
||||
Author : Robert Osfield
|
||||
Added check under Windows for a concatinated path that exceeds the MAX_PATH so that it isn't used for file IO operations that could lead to undefined behavior https://github.com/openscenegraph/OpenSceneGraph/issues/634
|
||||
|
||||
Mon, 15 Oct 2018 11:03:54 -0700
|
||||
Author : flashk
|
||||
Update ReaderWriterDAE.cpp
|
||||
|
||||
Thu, 11 Oct 2018 16:13:01 -0700
|
||||
Author : flashk
|
||||
Fix crash in Collada loaderThe collada loader would crash when processing effects that didn't have a technique defined.
|
||||
|
||||
Wed, 10 Oct 2018 02:33:47 +0300
|
||||
Author : Boris Pek
|
||||
fix builds with case sensitive includesTested during cross-compilation for MS Windows using MinGW.
|
||||
|
||||
|
||||
Wed, 10 Oct 2018 13:10:55 +0100
|
||||
Author : Robert Osfield
|
||||
Fixed buld
|
||||
|
||||
Wed, 10 Oct 2018 08:31:30 +0200
|
||||
Author : Antoine Lavenant
|
||||
fix apply once
|
||||
|
||||
Wed, 3 Oct 2018 14:21:03 -0700
|
||||
Author : flashk
|
||||
Fix for HDR DDS imagesThe DDS loader was not applying the correct internal format for certain HDR images (e.g. float/half_float formats)
|
||||
|
||||
Wed, 3 Oct 2018 14:12:54 -0700
|
||||
Author : flashk
|
||||
osgDB::OutputStream write array optimizationI've made a change to osgDB::OutputStream::writeArrayImplementation so that it writes the array data in a single write operation for binary files. This significantly speeds up writing out osgb files for large data sets (e.g. point clouds). osgDB::InputStream already performs a similar optimization when reading array data from binary files.
|
||||
|
||||
Wed, 3 Oct 2018 11:32:10 -0700
|
||||
Author : flashk
|
||||
Fix for GifImageStream::setReferenceTimeSetting the reference time greater than the duration of a gif would cause a crash. Also, the current reference time is not immediately updated when manually setting the reference time.
|
||||
|
||||
Wed, 3 Oct 2018 09:59:34 -0700
|
||||
Author : flashk
|
||||
Update ReaderWriterFBX.cpp
|
||||
|
||||
Wed, 3 Oct 2018 09:52:10 -0700
|
||||
Author : flashk
|
||||
Update fbxRMesh.cpp
|
||||
|
||||
Wed, 3 Oct 2018 09:49:37 -0700
|
||||
Author : flashk
|
||||
Update fbxReader.h
|
||||
|
||||
Tue, 2 Oct 2018 09:04:26 -0700
|
||||
Author : flashk
|
||||
Fix hardware mipmap generation for cube mapsI was getting a black image when enabling hardware mipmap generation on cubemaps. I believe the problem is that the base Texture class is hard coding GL_TEXTURE_2D when enabling mipmap generation, instead of using the target type from the derived class.
|
||||
|
||||
Tue, 2 Oct 2018 12:21:31 +0100
|
||||
Author : Robert Osfield
|
||||
Removed unused static variables
|
||||
|
||||
Tue, 2 Oct 2018 11:28:34 +0100
|
||||
Author : Robert Osfield
|
||||
From Andy Skinner, Added ~GLExtensions to clear cached values for context ID
|
||||
|
||||
Mon, 1 Oct 2018 23:13:10 +0200
|
||||
Author : Julien Valentin
|
||||
add version and required extensionlet a chance to work on intel chipset
|
||||
|
||||
Tue, 2 Oct 2018 10:46:25 +0100
|
||||
Author : OpenSceneGraph git repository
|
||||
Merge pull request #627 from eligovision/OpenSceneGraph-3.6_gui_adapters_1px1px error in GUIEventAdapter, View, Viewer and CompositeViewer major fix
|
||||
|
||||
Fri, 21 Sep 2018 13:26:18 +0300
|
||||
Author : Konstantin S. Matveyev
|
||||
1px error in GUIEventAdapter, View, Viewer and CompositeViewer major fix
|
||||
|
||||
Fri, 14 Sep 2018 11:16:53 +0100
|
||||
Author : Robert Osfield
|
||||
Updated ChangeLog for 3.6.3 release
|
||||
|
||||
Fri, 14 Sep 2018 10:41:24 +0100
|
||||
Author : Robert Osfield
|
||||
Updated version number and date for 3.6.3 stable release
|
||||
|
||||
19
README.md
19
README.md
@@ -25,7 +25,7 @@ If details below are not sufficient then head over to the openscenegraph.org to
|
||||
|
||||
Robert Osfield.
|
||||
Project Lead.
|
||||
14th September 2018.
|
||||
25th July 2019.
|
||||
|
||||
---
|
||||
|
||||
@@ -88,13 +88,14 @@ Many of the example programs use command-line arguments. When double-clicking on
|
||||
|
||||
## Section 3. Release notes on iOS build, by Thomas Hogarth
|
||||
|
||||
With CMake, XCode and the iOS sdk installed you can generate an iOS XCode project using the following command line:
|
||||
With CMake 3.11, XCode 9.4 and the iOS sdk 11.4 installed you can generate an iOS XCode project using the following command line:
|
||||
|
||||
export THIRDPARTY_PATH=/path/to/my/3rdParty
|
||||
export THIRDPARTY_PATH=/path/to/3rdParty
|
||||
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
|
||||
-DIPHONE_SDKVER="10.2" \
|
||||
-DIPHONE_VERSION_MIN="8.0" \
|
||||
-DOPENGL_PROFILE:STRING=GLES2 \
|
||||
-DIPHONE_SDKVER="11.4" \
|
||||
-DIPHONE_VERSION_MIN="10.0" \
|
||||
-DOPENGL_PROFILE:STRING=GLES3 \
|
||||
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \
|
||||
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
|
||||
-DBUILD_OSG_EXAMPLES:BOOL=ON \
|
||||
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
|
||||
@@ -105,15 +106,15 @@ With CMake, XCode and the iOS sdk installed you can generate an iOS XCode projec
|
||||
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \
|
||||
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
|
||||
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
|
||||
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreeType_iphone_universal.a" \
|
||||
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreetype2.a" \
|
||||
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
|
||||
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
|
||||
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
|
||||
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"
|
||||
|
||||
|
||||
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 10.2. IPHONE_VERSION_MIN controls the base sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
|
||||
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 11.4. IPHONE_VERSION_MIN controls the deployment sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
|
||||
|
||||
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team. In the 'Build Settings' tab search for 'Other Linker Flags', then for each target type (debug, release etc) that you want to use open the list of arguments and delete the 'OpenGL' line and the '-framework' line above it. This is because cmake has tried to add the desktop OpenGL library which we don't want.
|
||||
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team.
|
||||
|
||||
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.
|
||||
|
||||
@@ -771,7 +771,7 @@ int main( int argc, char **argv )
|
||||
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
|
||||
}
|
||||
|
||||
std::string fileNameOut("converted.osg");
|
||||
std::string fileNameOut("converted.osgt");
|
||||
if (fileNames.size()>1)
|
||||
{
|
||||
fileNameOut = fileNames.back();
|
||||
@@ -780,29 +780,66 @@ int main( int argc, char **argv )
|
||||
|
||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
|
||||
osg::ref_ptr<osg::Node> root = osgDB::readRefNodeFiles(fileNames);
|
||||
typedef std::vector< osg::ref_ptr<osg::Image> > Images;
|
||||
typedef std::vector< osg::ref_ptr<osg::Node> > Nodes;
|
||||
typedef std::vector< osg::ref_ptr<osg::Object> > Objects;
|
||||
|
||||
if (root.valid())
|
||||
Images images;
|
||||
Nodes nodes;
|
||||
Objects objects;
|
||||
|
||||
for(FileNameList::iterator itr = fileNames.begin();
|
||||
itr != fileNames.end();
|
||||
++itr)
|
||||
{
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
|
||||
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(*itr);
|
||||
if (object.valid())
|
||||
{
|
||||
if (object->asNode()) nodes.push_back(object->asNode());
|
||||
else if (object->asImage()) images.push_back(object->asImage());
|
||||
else objects.push_back(object);
|
||||
}
|
||||
}
|
||||
|
||||
if (images.empty() && nodes.empty() && objects.empty())
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Warning: failed to load any files"<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (pruneStateSet)
|
||||
{
|
||||
PruneStateSetVisitor pssv;
|
||||
root->accept(pssv);
|
||||
}
|
||||
osg::Timer_t endTick = osg::Timer::instance()->tick();
|
||||
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
|
||||
|
||||
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
|
||||
osg::ref_ptr<osg::Node> root;
|
||||
|
||||
if (nodes.size()==1) root = nodes.front();
|
||||
else if (nodes.size()>1)
|
||||
{
|
||||
FixTransparencyVisitor atv(fixTransparencyMode);
|
||||
root->accept(atv);
|
||||
osg::ref_ptr<osg::Group> group = new osg::Group;
|
||||
for(Nodes::iterator itr = nodes.begin();
|
||||
itr != nodes.end();
|
||||
++itr)
|
||||
{
|
||||
group->addChild(itr->get());
|
||||
}
|
||||
|
||||
root = group;
|
||||
}
|
||||
|
||||
if ( root.valid() )
|
||||
{
|
||||
if (pruneStateSet)
|
||||
{
|
||||
PruneStateSetVisitor pssv;
|
||||
root->accept(pssv);
|
||||
}
|
||||
|
||||
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
|
||||
{
|
||||
FixTransparencyVisitor atv(fixTransparencyMode);
|
||||
root->accept(atv);
|
||||
}
|
||||
|
||||
if (smooth)
|
||||
{
|
||||
@@ -868,6 +905,20 @@ int main( int argc, char **argv )
|
||||
osg::notify(osg::NOTICE)<<result.message()<< std::endl;
|
||||
}
|
||||
}
|
||||
else if (!images.empty())
|
||||
{
|
||||
if (images.size()>1)
|
||||
{
|
||||
OSG_NOTICE<<"Warning: osgconv does not support writing multiple to a single file."<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
osgDB::writeImageFile(*images.front(), fileNameOut);
|
||||
}
|
||||
else if (!objects.empty())
|
||||
{
|
||||
osgDB::writeObjectFile(*images.front(), fileNameOut);
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <osg/Plane>
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/BoundingSphere>
|
||||
#include <osg/Quat>
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
extern void printContributors(const std::string& changeLog, bool printNumEntries);
|
||||
@@ -40,6 +41,7 @@ int main( int argc, char** argv)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("Quat::value_type", "Print the value of Quat::value_type");
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
|
||||
@@ -139,6 +141,12 @@ int main( int argc, char** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arguments.read("Quat::value_type"))
|
||||
{
|
||||
cout << ((sizeof(osg::Quat::value_type) == 4) ? "float" : "double") << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
|
||||
|
||||
#ifdef BUILD_CONTRIBUTORS
|
||||
|
||||
@@ -48,6 +48,7 @@ int main(int argc, char** argv)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--stats","print out load and compile timing stats");
|
||||
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
@@ -71,6 +72,8 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool printStats = arguments.read("--stats");
|
||||
|
||||
std::string url, username, password;
|
||||
while(arguments.read("--login",url, username, password))
|
||||
{
|
||||
@@ -109,7 +112,7 @@ int main(int argc, char** argv)
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm && !apm->getAnimationPath()->empty())
|
||||
{
|
||||
apm->setTimeScale(animationSpeed);
|
||||
|
||||
@@ -147,6 +150,8 @@ int main(int argc, char** argv)
|
||||
// add the screen capture handler
|
||||
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
||||
|
||||
osg::ElapsedTime elapsedTime;
|
||||
|
||||
// load the data
|
||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
|
||||
if (!loadedModel)
|
||||
@@ -155,6 +160,15 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (printStats)
|
||||
{
|
||||
double loadTime = elapsedTime.elapsedTime_m();
|
||||
std::cout<<"Load time "<<loadTime<<"ms"<<std::endl;
|
||||
|
||||
viewer.getStats()->collectStats("compile", true);
|
||||
}
|
||||
|
||||
|
||||
// any option left unread are converted into errors to write out later.
|
||||
arguments.reportRemainingOptionsAsUnrecognized();
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm && !apm->getAnimationPath()->empty())
|
||||
{
|
||||
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
|
||||
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
|
||||
|
||||
@@ -243,13 +243,11 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
|
||||
#needed on win32 or the linker get confused by _declspec declarations
|
||||
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
||||
|
||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||
|
||||
# IPHONE_PORT@tom
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
ADD_SUBDIRECTORY(osgviewerIPhone)
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(osgstaticviewer)
|
||||
ENDIF()
|
||||
# IPHONE_PORT@tom
|
||||
|
||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm && !apm->getAnimationPath()->empty())
|
||||
{
|
||||
apm->setTimeScale(animationSpeed);
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ createStateSet()
|
||||
// render each instance uniquely. gl_InstanceID will be in the range
|
||||
// 0 to numInstances-1 (1023 in our case).
|
||||
std::string vertexSource =
|
||||
"#extension GL_EXT_gpu_shader4 : enable\n"
|
||||
"uniform sampler2D osgLogo; \n"
|
||||
"uniform float osg_SimulationTime; \n"
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <osg/FragmentProgram>
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/WriteFile>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <osgUtil/LineSegmentIntersector>
|
||||
@@ -64,6 +65,18 @@ public:
|
||||
|
||||
ForestTechniqueManager() {}
|
||||
|
||||
enum Features
|
||||
{
|
||||
HUD_TEXT = 1,
|
||||
BILLBOARD_GRAPH = 2,
|
||||
X_GRAPH = 4,
|
||||
TRANSFORM_GRAPH = 8,
|
||||
SHADER_GRAPH = 16,
|
||||
GEOMETRY_SHADER_GRAPH = 32,
|
||||
TEXTURE_BUFFER_GRAPH = 64,
|
||||
ALL_FEATURES = (TEXTURE_BUFFER_GRAPH<<1)-1
|
||||
};
|
||||
|
||||
class Tree : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
@@ -150,7 +163,7 @@ public:
|
||||
|
||||
osg::Node* createHUDWithText(const std::string& text);
|
||||
|
||||
osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell);
|
||||
osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask=ALL_FEATURES);
|
||||
|
||||
void advanceToNextTechnique(int delta=1)
|
||||
{
|
||||
@@ -803,6 +816,18 @@ class ShaderGeometry : public osg::Drawable
|
||||
|
||||
typedef std::vector<osg::Vec4> PositionSizeList;
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
osg::Drawable::resizeGLObjectBuffers(maxSize);
|
||||
if (_geometry) _geometry->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
virtual void releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
osg::Drawable::releaseGLObjects(state);
|
||||
if (_geometry) _geometry->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
virtual void drawImplementation(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
for(PositionSizeList::const_iterator itr = _trees.begin();
|
||||
@@ -1160,7 +1185,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str)
|
||||
return projection;
|
||||
}
|
||||
|
||||
osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell)
|
||||
osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask)
|
||||
{
|
||||
osg::Vec3 origin(0.0f,0.0f,0.0f);
|
||||
osg::Vec3 size(1000.0f,1000.0f,200.0f);
|
||||
@@ -1206,33 +1231,37 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
|
||||
_techniqueSwitch = new osg::Switch;
|
||||
|
||||
if ((mask & BILLBOARD_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating osg::Billboard based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createBillboardGraph(cell.get(),dstate));
|
||||
group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & X_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating double quad based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createXGraph(cell.get(),dstate));
|
||||
group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & TRANSFORM_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating osg::MatrixTransform based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createTransformGraph(cell.get(),dstate));
|
||||
group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & SHADER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating osg::Vertex/FragmentProgram based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
@@ -1289,11 +1318,12 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
}
|
||||
|
||||
group->addChild(createShaderGraph(cell.get(),stateset));
|
||||
group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & SHADER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating OpenGL shader based forest...";
|
||||
osg::Group* group = new osg::Group;
|
||||
@@ -1351,11 +1381,12 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
}
|
||||
|
||||
group->addChild(createShaderGraph(cell.get(),stateset));
|
||||
group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest"));
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & GEOMETRY_SHADER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating Geometry Shader based forest...";
|
||||
|
||||
@@ -1363,12 +1394,13 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(createGeometryShaderGraph(cell.get(), stateset));
|
||||
group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object"));
|
||||
|
||||
_techniqueSwitch->addChild(group);
|
||||
std::cout<<"done."<<std::endl;
|
||||
}
|
||||
|
||||
if ((mask & TEXTURE_BUFFER_GRAPH)!=0)
|
||||
{
|
||||
std::cout<<"Creating forest using geometry instancing and texture buffer objects ...";
|
||||
|
||||
@@ -1430,7 +1462,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
|
||||
textureBufferGraph->setStateSet( stateset );
|
||||
osg::Group* group = new osg::Group;
|
||||
group->addChild(textureBufferGraph);
|
||||
group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest"));
|
||||
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest"));
|
||||
|
||||
_techniqueSwitch->addChild(group);
|
||||
|
||||
@@ -1466,6 +1498,16 @@ int main( int argc, char **argv )
|
||||
|
||||
arguments.read("--trees-per-cell",maxNumTreesPerCell);
|
||||
|
||||
|
||||
unsigned int features = ForestTechniqueManager::ALL_FEATURES;
|
||||
while(arguments.read("--features", features))
|
||||
{
|
||||
std::cout<<"features = "<<features<<std::endl;
|
||||
}
|
||||
|
||||
std::string outputFilename;
|
||||
while(arguments.read("-o", outputFilename)) {}
|
||||
|
||||
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
|
||||
|
||||
// add the stats handler
|
||||
@@ -1475,8 +1517,13 @@ int main( int argc, char **argv )
|
||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
||||
|
||||
// add model to viewer.
|
||||
viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell) );
|
||||
viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell, features) );
|
||||
|
||||
if (!outputFilename.empty())
|
||||
{
|
||||
osgDB::writeNodeFile(*viewer.getSceneData(), outputFilename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return viewer.run();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#pragma warning( disable : 4244 )
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,9 +43,15 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
|
||||
{
|
||||
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
|
||||
if (ea.getEventType() == osgGA::GUIEventAdapter::PUSH)
|
||||
{
|
||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||
if (view) pick(view,ea);
|
||||
return false;
|
||||
}
|
||||
else if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
|
||||
{
|
||||
if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Up)
|
||||
{
|
||||
@@ -83,6 +89,24 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
void pick(osgViewer::View* view, const osgGA::GUIEventAdapter& ea)
|
||||
{
|
||||
osgUtil::LineSegmentIntersector::Intersections intersections;
|
||||
if (view->computeIntersections(ea, intersections))
|
||||
{
|
||||
OSG_NOTICE<<"found intersections : "<<std::endl;
|
||||
for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin();
|
||||
itr != intersections.end();
|
||||
++itr)
|
||||
{
|
||||
OSG_NOTICE<<" intersection "<<itr->localIntersectionPoint<<std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_NOTICE<<"failed to get intersection "<<std::endl;
|
||||
}
|
||||
}
|
||||
private:
|
||||
osgText::Text3D* m_Text3D;
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
|
||||
#backup setting
|
||||
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
||||
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
||||
SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
|
||||
#SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
|
||||
SETUP_EXAMPLE(osgViewerIPhone)
|
||||
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
|
||||
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONE_VERSION_MIN}
|
||||
@@ -35,4 +35,4 @@ SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SI
|
||||
|
||||
#restore setting
|
||||
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")
|
||||
|
||||
@@ -599,12 +599,12 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
Callback(org, copyop) {}
|
||||
|
||||
META_Object(osg, DrawCallback);
|
||||
|
||||
|
||||
/** Functor method called by rendering thread to recursively launch operator() on _nestedcallback **/
|
||||
inline void run(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
operator () (renderInfo);
|
||||
|
||||
|
||||
if (_nestedCallback.valid())
|
||||
((const DrawCallback*)_nestedCallback.get())->run(renderInfo);
|
||||
}
|
||||
@@ -614,6 +614,23 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
|
||||
/** Functor method, provided for backwards compatibility, called by operator() (osg::RenderInfo& renderInfo) method.**/
|
||||
virtual void operator () (const osg::Camera& /*camera*/) const {}
|
||||
|
||||
/** Resize any per context GLObject buffers to specified size. */
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_nestedCallback.valid())
|
||||
_nestedCallback->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const
|
||||
{
|
||||
if (_nestedCallback.valid())
|
||||
_nestedCallback->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/** Set the initial draw callback for custom operations to be done before the drawing of the camera's subgraph and pre render stages.*/
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
// #define INLINE_DRAWABLE_DRAW
|
||||
#define INLINE_DRAWABLE_DRAW
|
||||
|
||||
namespace osg {
|
||||
|
||||
|
||||
@@ -304,6 +304,9 @@ class OSG_EXPORT FrameBufferAttachment
|
||||
unsigned int getTexture3DZOffset() const;
|
||||
unsigned int getTextureArrayLayer() const;
|
||||
|
||||
void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
private:
|
||||
// use the Pimpl idiom to avoid dependency from
|
||||
// all Texture* headers
|
||||
|
||||
@@ -813,6 +813,9 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
|
||||
/** convenience wrapper around glObjectLabel that calls glObjectLabel if it's supported and using std::string as a label parameter.*/
|
||||
void debugObjectLabel(GLenum identifier, GLuint name, const std::string& label) const { if (glObjectLabel && !label.empty()) glObjectLabel(identifier, name, label.size(), label.c_str()); }
|
||||
|
||||
protected:
|
||||
virtual ~GLExtensions();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,14 @@ struct OSG_EXPORT GraphicsOperation : public Operation
|
||||
virtual void operator () (Object* object);
|
||||
|
||||
virtual void operator () (GraphicsContext* context) = 0;
|
||||
|
||||
/** Resize any per context GLObject buffers to specified size. */
|
||||
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objects
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
namespace osg {
|
||||
|
||||
// forward declare
|
||||
class State;
|
||||
class UserDataContainer;
|
||||
class Node;
|
||||
class NodeVisitor;
|
||||
|
||||
@@ -72,6 +72,18 @@ public:
|
||||
|
||||
virtual void drawImplementation( osg::RenderInfo& renderInfo ) const;
|
||||
|
||||
struct QueryResult
|
||||
{
|
||||
QueryResult() : valid(false), numPixels(0) {}
|
||||
QueryResult(bool v, unsigned int p) : valid(v), numPixels(p) {}
|
||||
|
||||
bool valid;
|
||||
unsigned int numPixels;
|
||||
};
|
||||
|
||||
/** return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are available, and in which case the QueryResult.numPixels provides the num of pixels in the query result.*/
|
||||
QueryResult getQueryResult( const osg::Camera* cam );
|
||||
|
||||
unsigned int getNumPixels( const osg::Camera* cam );
|
||||
|
||||
virtual void releaseGLObjects( osg::State* state = 0 ) const;
|
||||
@@ -125,6 +137,11 @@ public:
|
||||
void setQueryFrameCount( unsigned int frames ) { _queryFrameCount = frames; }
|
||||
unsigned int getQueryFrameCount() const { return _queryFrameCount; }
|
||||
|
||||
// Resets the queries. The next frame will issue a new query.
|
||||
// This is useful for big view changes, if it shouldn't be waited for
|
||||
// '_queryFrameCount' till the frame contents change.
|
||||
void resetQueries();
|
||||
|
||||
// Indicate whether or not the bounding box used in the occlusion query test
|
||||
// should be rendered. Handy for debugging and development.
|
||||
// Should only be called outside of cull/draw. No thread issues.
|
||||
@@ -181,6 +198,9 @@ protected:
|
||||
|
||||
bool _enabled;
|
||||
|
||||
// If the box of the query geometry is valid.
|
||||
mutable bool _validQueryGeometry;
|
||||
|
||||
// Tracks the last frame number that we performed a query.
|
||||
// User can set how many times (See setQueryFrameCount).
|
||||
typedef std::map< const osg::Camera*, unsigned int > FrameCountMap;
|
||||
|
||||
@@ -32,7 +32,11 @@ class OSG_EXPORT Quat
|
||||
public:
|
||||
|
||||
/** Data type of vector components.*/
|
||||
#ifdef OSG_USE_FLOAT_QUAT
|
||||
typedef float value_type;
|
||||
#else
|
||||
typedef double value_type;
|
||||
#endif
|
||||
|
||||
/** Number of vector components. */
|
||||
enum { num_components = 4 };
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace osg {
|
||||
class DeleteHandler;
|
||||
class Observer;
|
||||
class ObserverSet;
|
||||
class State;
|
||||
|
||||
/** template class to help enforce static initialization order. */
|
||||
template <typename T, T M()>
|
||||
@@ -114,8 +115,16 @@ class OSG_EXPORT Referenced
|
||||
|
||||
/** Remove Observer that is observing this object.*/
|
||||
void removeObserver(Observer* observer) const;
|
||||
#if 0
|
||||
/** Resize any per context GLObject buffers to specified size. */
|
||||
virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {}
|
||||
|
||||
public:
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objects
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const {}
|
||||
#endif
|
||||
public:
|
||||
|
||||
friend class DeleteHandler;
|
||||
|
||||
|
||||
@@ -549,6 +549,13 @@ class OSG_EXPORT State : public Referenced
|
||||
/** Set the getCurrentVertexArrayState to the GlobalVertexArrayState.*/
|
||||
void setCurrentToGlobalVertexArrayState() { _vas = _globalVertexArrayState.get(); }
|
||||
|
||||
/** Reset the CurrentVertexArrayState/VertexArrayObject if it's value matches the specificied vas - use when deleting a vas.*/
|
||||
void resetCurrentVertexArrayStateOnMatch(VertexArrayState* vas)
|
||||
{
|
||||
if (vas->getVertexArrayObject()== _currentVAO) _currentVAO = 0;
|
||||
if (_vas==vas) _vas = _globalVertexArrayState.get();
|
||||
}
|
||||
|
||||
|
||||
/** disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.*/
|
||||
void disableAllVertexArrays();
|
||||
|
||||
@@ -182,10 +182,12 @@ class OSG_EXPORT VertexArrayState : public osg::Referenced
|
||||
|
||||
public:
|
||||
|
||||
virtual ~VertexArrayState();
|
||||
|
||||
// osg::GLBufferObject* getGLBufferObject(osg::Array* array);
|
||||
|
||||
osg::State* _state;
|
||||
osg::ref_ptr<ObserverSet> _stateObserverSet;
|
||||
osg::ref_ptr<osg::GLExtensions> _ext;
|
||||
|
||||
bool _isVertexBufferObjectSupported;
|
||||
|
||||
@@ -161,6 +161,9 @@ class OSG_EXPORT View : public virtual osg::Object
|
||||
|
||||
void updateSlaves();
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
protected :
|
||||
|
||||
virtual ~View();
|
||||
|
||||
@@ -120,6 +120,8 @@ class OSGDB_EXPORT ImageOptions : public osgDB::Options
|
||||
}
|
||||
|
||||
double _x,_y,_w,_h;
|
||||
protected:
|
||||
virtual ~TexCoordRange() {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -55,10 +55,10 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced
|
||||
/** Remove Object from cache.*/
|
||||
void removeFromObjectCache(const std::string& fileName, const Options *options = NULL);
|
||||
|
||||
/** Get an Object from the object cache*/
|
||||
/** Deprecated, the getFromObjectCache() returns a C pointer that is not thread safe when using database paging, please use the thread safe getRefFromObjectCache() method instead. */
|
||||
osg::Object* getFromObjectCache(const std::string& fileName, const Options *options = NULL);
|
||||
|
||||
/** Get an ref_ptr<Object> from the object cache*/
|
||||
/** Get a thread safe ref_ptr<Object> from the object cache*/
|
||||
osg::ref_ptr<osg::Object> getRefFromObjectCache(const std::string& fileName, const Options *options = NULL);
|
||||
|
||||
/** call rleaseGLObjects on all objects attached to the object cache.*/
|
||||
|
||||
@@ -62,8 +62,9 @@ protected:
|
||||
// Return true if the manipulator is std::endl
|
||||
bool isEndl( std::ostream& (*fn)(std::ostream&) )
|
||||
{
|
||||
#ifdef __sun
|
||||
#if defined (__sun) || (defined _WIN32 && !defined OSG_LIBRARY_STATIC)
|
||||
// What a mess, but solaris does not like taking the address below
|
||||
// windows std::endl is a template with different adresses in different dll's
|
||||
std::stringstream ss;
|
||||
ss << fn;
|
||||
std::string s = ss.str();
|
||||
|
||||
@@ -119,6 +119,9 @@ namespace osgFX
|
||||
/** default traversal */
|
||||
inline void inherited_traverse(osg::NodeVisitor& nv);
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const;
|
||||
|
||||
protected:
|
||||
virtual ~Effect();
|
||||
Effect &operator=(const Effect &) { return *this; }
|
||||
|
||||
@@ -42,6 +42,21 @@ namespace osgParticle
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
virtual osg::Vec2 interpolate(float t, const osg::Vec2& y1, const osg::Vec2& y2) const
|
||||
{
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
virtual osg::Vec3 interpolate(float t, const osg::Vec3& y1, const osg::Vec3& y2) const
|
||||
{
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
virtual osg::Vec4 interpolate(float t, const osg::Vec4& y1, const osg::Vec4& y2) const
|
||||
{
|
||||
return y1 + (y2 - y1) * t;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~LinearInterpolator() {}
|
||||
};
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace osgParticle
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* state=0) const;
|
||||
|
||||
virtual osg::VertexArrayState* createVertexArrayStateImplemenation(osg::RenderInfo& renderInfo) const;
|
||||
virtual osg::VertexArrayState* createVertexArrayStateImplementation(osg::RenderInfo& renderInfo) const;
|
||||
|
||||
void adjustEstimatedMaxNumOfParticles(int delta) { _estimatedMaxNumOfParticles += delta; }
|
||||
|
||||
|
||||
@@ -37,8 +37,10 @@ namespace osgParticle
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const PrecipitationEffect*>(obj) != 0; }
|
||||
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } }
|
||||
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const;
|
||||
|
||||
virtual void traverse(osg::NodeVisitor& nv);
|
||||
|
||||
/** Set all the parameters to create an rain effect of specified intensity.*/
|
||||
void rain(float intensity);
|
||||
@@ -117,6 +119,9 @@ namespace osgParticle
|
||||
void setNumberOfVertices(unsigned int numVertices) { _numberOfVertices = numVertices; }
|
||||
unsigned int getNumberOfVertices() const { return _numberOfVertices; }
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state) const;
|
||||
|
||||
virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
|
||||
|
||||
struct Cell
|
||||
@@ -174,7 +179,7 @@ namespace osgParticle
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~PrecipitationDrawable() {}
|
||||
virtual ~PrecipitationDrawable();
|
||||
|
||||
bool _requiresPreviousMatrix;
|
||||
|
||||
|
||||
@@ -240,6 +240,10 @@ public:
|
||||
/** recompute the primitives rendering meshes/lines thtat represent the sphere segment.*/
|
||||
void updatePrimitives();
|
||||
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const;
|
||||
|
||||
virtual osg::BoundingSphere computeBound() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
virtual std::string getFileName() const;
|
||||
|
||||
static osg::ref_ptr<Font>& getDefaultFont();
|
||||
static osg::ref_ptr<Font> getDefaultFont();
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osg::StateSet> > StateSets;
|
||||
StateSets& getCachedStateSets() { return _statesets; }
|
||||
|
||||
@@ -46,11 +46,16 @@ class OSGUTIL_EXPORT IndexMeshVisitor : public GeometryCollector
|
||||
{
|
||||
public:
|
||||
IndexMeshVisitor(Optimizer* optimizer = 0)
|
||||
: GeometryCollector(optimizer, Optimizer::INDEX_MESH)
|
||||
: GeometryCollector(optimizer, Optimizer::INDEX_MESH), _generateNewIndicesOnAllGeometries(false)
|
||||
{
|
||||
}
|
||||
inline void setGenerateNewIndicesOnAllGeometries(bool b) { _generateNewIndicesOnAllGeometries = b; }
|
||||
inline bool getGenerateNewIndicesOnAllGeometries() const { return _generateNewIndicesOnAllGeometries; }
|
||||
|
||||
void makeMesh(osg::Geometry& geom);
|
||||
void makeMesh();
|
||||
protected:
|
||||
bool _generateNewIndicesOnAllGeometries;
|
||||
};
|
||||
|
||||
// Optimize the triangle order in a mesh for best use of the GPU's
|
||||
|
||||
@@ -72,6 +72,16 @@ class OSGUTIL_EXPORT RenderLeaf : public osg::Referenced
|
||||
|
||||
virtual void render(osg::RenderInfo& renderInfo,RenderLeaf* previous);
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_drawable) _drawable->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
virtual void releaseGLObjects(osg::State* state=0) const
|
||||
{
|
||||
if (_drawable) _drawable->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
/// Allow StateGraph to change the RenderLeaf's _parent.
|
||||
friend class osgUtil::StateGraph;
|
||||
|
||||
|
||||
@@ -484,6 +484,9 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
|
||||
* then need to be deleted in OpenGL by SceneView::flushAllDeleteGLObjects(). */
|
||||
virtual void releaseAllGLObjects();
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
/** Flush all deleted OpenGL objects, such as texture objects, display lists, etc.*/
|
||||
virtual void flushAllDeletedGLObjects();
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@ struct LessDepthSortFunctor
|
||||
|
||||
/** StateGraph - contained in a renderBin, defines the scene to be drawn.
|
||||
*/
|
||||
class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
class OSGUTIL_EXPORT StateGraph : public osg::Object
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
typedef std::map< const osg::StateSet*, osg::ref_ptr<StateGraph> > ChildList;
|
||||
typedef std::vector< osg::ref_ptr<RenderLeaf> > LeafList;
|
||||
typedef std::map< const osg::StateSet*, osg::ref_ptr<StateGraph> > ChildList;
|
||||
typedef std::vector< osg::ref_ptr<RenderLeaf> > LeafList;
|
||||
|
||||
StateGraph* _parent;
|
||||
|
||||
@@ -66,7 +66,6 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
bool _dynamic;
|
||||
|
||||
StateGraph():
|
||||
osg::Referenced(false),
|
||||
_parent(NULL),
|
||||
_stateset(NULL),
|
||||
_depth(0),
|
||||
@@ -78,7 +77,6 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
}
|
||||
|
||||
StateGraph(StateGraph* parent,const osg::StateSet* stateset):
|
||||
osg::Referenced(false),
|
||||
_parent(parent),
|
||||
_stateset(stateset),
|
||||
_depth(0),
|
||||
@@ -95,7 +93,13 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
|
||||
~StateGraph() {}
|
||||
|
||||
StateGraph* cloneType() const { return new StateGraph; }
|
||||
|
||||
virtual osg::Object* cloneType() const { return new StateGraph(); }
|
||||
virtual StateGraph* cloneStateGraph() const { return new StateGraph(); }
|
||||
virtual osg::Object* clone(const osg::CopyOp&) const { return new StateGraph(); }
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const StateGraph*>(obj)!=0L; }
|
||||
virtual const char* libraryName() const { return "osgUtil"; }
|
||||
virtual const char* className() const { return "StateGraph"; }
|
||||
|
||||
void setUserData(osg::Referenced* obj) { _userData = obj; }
|
||||
osg::Referenced* getUserData() { return _userData.get(); }
|
||||
@@ -172,6 +176,42 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
void prune();
|
||||
|
||||
|
||||
void resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
for(ChildList::iterator itr = _children.begin();
|
||||
itr != _children.end();
|
||||
++itr)
|
||||
{
|
||||
(itr->second)->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
for(LeafList::iterator itr = _leaves.begin();
|
||||
itr != _leaves.end();
|
||||
++itr)
|
||||
{
|
||||
(*itr)->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
void releaseGLObjects(osg::State* state=0) const
|
||||
{
|
||||
if (_stateset) _stateset->releaseGLObjects(state);
|
||||
|
||||
for(ChildList::const_iterator itr = _children.begin();
|
||||
itr != _children.end();
|
||||
++itr)
|
||||
{
|
||||
(itr->second)->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
for(LeafList::const_iterator itr = _leaves.begin();
|
||||
itr != _leaves.end();
|
||||
++itr)
|
||||
{
|
||||
(*itr)->releaseGLObjects(state);
|
||||
}
|
||||
}
|
||||
|
||||
inline StateGraph* find_or_insert(const osg::StateSet* stateset)
|
||||
{
|
||||
// search for the appropriate state group, return it if found.
|
||||
@@ -309,7 +349,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
private:
|
||||
|
||||
/// disallow copy construction.
|
||||
StateGraph(const StateGraph&):osg::Referenced() {}
|
||||
StateGraph(const StateGraph&) : osg::Object() {}
|
||||
/// disallow copy operator.
|
||||
StateGraph& operator = (const StateGraph&) { return *this; }
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ class OSGVIEWER_EXPORT Renderer : public osg::GraphicsOperation
|
||||
|
||||
virtual void compile();
|
||||
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize);
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
void setCompileOnNextDraw(bool flag) { _compileOnNextDraw = flag; }
|
||||
bool getCompileOnNextDraw() const { return _compileOnNextDraw; }
|
||||
|
||||
|
||||
@@ -113,6 +113,9 @@ class OSGVIEWER_EXPORT Viewer : public ViewerBase, public osgViewer::View
|
||||
/** Get the keyboard and mouse usage of this viewer.*/
|
||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||
|
||||
// ensure that osg::View provides the reiszerGLObjects and releaseGLObjects methods
|
||||
virtual void resizeGLObjectBuffers(unsigned int maxSize) { osg::View::resizeGLObjectBuffers(maxSize); }
|
||||
virtual void releaseGLObjects(osg::State* state = 0) const { osg::View::releaseGLObjects(state); }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -285,14 +285,16 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
|
||||
|
||||
private:
|
||||
// A functor used to sort the Windows by their Z component in descending order.
|
||||
struct WindowZCompare: public std::binary_function<ptr_type, ptr_type, bool> {
|
||||
struct WindowZCompare
|
||||
{
|
||||
bool operator()(const ptr_type& x, const ptr_type& y) {
|
||||
return x.get()->getZ() > y.get()->getZ();
|
||||
}
|
||||
};
|
||||
|
||||
// A functor used to sort the Windows by their BinNum component in descending order.
|
||||
struct WindowBinNumberCompare: public std::binary_function<ptr_type, ptr_type, bool> {
|
||||
struct WindowBinNumberCompare
|
||||
{
|
||||
bool operator()(const ptr_type& x, const ptr_type& y) {
|
||||
return
|
||||
x.get()->getOrCreateStateSet()->getBinNumber() >
|
||||
|
||||
@@ -130,7 +130,7 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -330,20 +330,26 @@ void Camera::detach(BufferComponent buffer)
|
||||
|
||||
void Camera::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_renderingCache.valid())
|
||||
{
|
||||
const_cast<Camera*>(this)->_renderingCache->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
if (_renderer.valid()) _renderer->resizeGLObjectBuffers(maxSize);
|
||||
if (_renderingCache.valid()) _renderingCache->resizeGLObjectBuffers(maxSize);
|
||||
|
||||
if (_initialDrawCallback.valid()) _initialDrawCallback->resizeGLObjectBuffers(maxSize);
|
||||
if (_preDrawCallback.valid()) _preDrawCallback->resizeGLObjectBuffers(maxSize);
|
||||
if (_postDrawCallback.valid()) _postDrawCallback->resizeGLObjectBuffers(maxSize);
|
||||
if (_finalDrawCallback.valid()) _finalDrawCallback->resizeGLObjectBuffers(maxSize);
|
||||
|
||||
Transform::resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
void Camera::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
if (_renderingCache.valid())
|
||||
{
|
||||
const_cast<Camera*>(this)->_renderingCache->releaseGLObjects(state);
|
||||
}
|
||||
if (_renderer.valid()) _renderer->releaseGLObjects(state);
|
||||
if (_renderingCache.valid()) _renderingCache->releaseGLObjects(state);
|
||||
|
||||
if (_initialDrawCallback.valid()) _initialDrawCallback->releaseGLObjects(state);
|
||||
if (_preDrawCallback.valid()) _preDrawCallback->releaseGLObjects(state);
|
||||
if (_postDrawCallback.valid()) _postDrawCallback->releaseGLObjects(state);
|
||||
if (_finalDrawCallback.valid()) _finalDrawCallback->releaseGLObjects(state);
|
||||
|
||||
Transform::releaseGLObjects(state);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#cmakedefine OSG_USE_FLOAT_PLANE
|
||||
#cmakedefine OSG_USE_FLOAT_BOUNDINGSPHERE
|
||||
#cmakedefine OSG_USE_FLOAT_BOUNDINGBOX
|
||||
#cmakedefine OSG_USE_FLOAT_QUAT
|
||||
#cmakedefine OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION
|
||||
#cmakedefine OSG_USE_REF_PTR_SAFE_DEREFERENCE
|
||||
#cmakedefine OSG_USE_UTF8_FILENAME
|
||||
|
||||
@@ -117,6 +117,8 @@ void CullSettings::readEnvironmentalVariables()
|
||||
|
||||
void CullSettings::readCommandLine(ArgumentParser& arguments)
|
||||
{
|
||||
OSG_INFO<<"CullSettings::readCommandLine(ArgumentParser& arguments)"<<std::endl;
|
||||
|
||||
// report the usage options.
|
||||
if (arguments.getApplicationUsage())
|
||||
{
|
||||
@@ -124,6 +126,11 @@ void CullSettings::readCommandLine(ArgumentParser& arguments)
|
||||
arguments.getApplicationUsage()->addCommandLineOption("--NEAR_FAR_RATIO <float>","Set the ratio between near and far planes - must greater than 0.0 but less than 1.0.");
|
||||
}
|
||||
|
||||
while(arguments.read("--NO_CULLING")) setCullingMode(NO_CULLING);
|
||||
while(arguments.read("--VIEW_FRUSTUM")) setCullingMode(VIEW_FRUSTUM_CULLING);
|
||||
while(arguments.read("--VIEW_FRUSTUM_SIDES") || arguments.read("--vfs") ) setCullingMode(VIEW_FRUSTUM_SIDES_CULLING);
|
||||
|
||||
|
||||
std::string str;
|
||||
while(arguments.read("--COMPUTE_NEAR_FAR_MODE",str))
|
||||
{
|
||||
|
||||
@@ -256,8 +256,28 @@ Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop):
|
||||
|
||||
Drawable::~Drawable()
|
||||
{
|
||||
_stateset = 0;
|
||||
Drawable::releaseGLObjects();
|
||||
// clean up display lists if assigned, for the display lists size we can't use glGLObjectSizeHint() as it's a virtual function, so have to default to a 0 size hint.
|
||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||
for(unsigned int i=0;i<_globjList.size();++i)
|
||||
{
|
||||
if (_globjList[i] != 0)
|
||||
{
|
||||
Drawable::deleteDisplayList(i,_globjList[i], 0); // we don't know getGLObjectSizeHint()
|
||||
_globjList[i] = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// clean up VertexArrayState
|
||||
for(unsigned int i=0; i<_vertexArrayStateList.size(); ++i)
|
||||
{
|
||||
VertexArrayState* vas = _vertexArrayStateList[i].get();
|
||||
if (vas)
|
||||
{
|
||||
vas->release();
|
||||
_vertexArrayStateList[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
osg::MatrixList Drawable::getWorldMatrices(const osg::Node* haltTraversalAtNode) const
|
||||
@@ -319,6 +339,7 @@ void Drawable::releaseGLObjects(State* state) const
|
||||
// current OpenGL context.
|
||||
unsigned int contextID = state->getContextID();
|
||||
|
||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||
if (_useDisplayList)
|
||||
{
|
||||
// get the globj for the current contextID.
|
||||
@@ -331,6 +352,7 @@ void Drawable::releaseGLObjects(State* state) const
|
||||
globj = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
VertexArrayState* vas = contextID <_vertexArrayStateList.size() ? _vertexArrayStateList[contextID].get() : 0;
|
||||
if (vas)
|
||||
|
||||
@@ -565,6 +565,18 @@ unsigned int FrameBufferAttachment::getTextureArrayLayer() const
|
||||
return _ximpl->zoffset;
|
||||
}
|
||||
|
||||
void FrameBufferAttachment::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_ximpl->renderbufferTarget.valid()) _ximpl->renderbufferTarget->resizeGLObjectBuffers(maxSize);
|
||||
if (_ximpl->textureTarget.valid()) _ximpl->textureTarget->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
void FrameBufferAttachment::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
if (_ximpl->renderbufferTarget.valid()) _ximpl->renderbufferTarget->releaseGLObjects(state);
|
||||
if (_ximpl->textureTarget.valid()) _ximpl->textureTarget->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* FrameBufferObject
|
||||
**************************************************************************/
|
||||
@@ -594,6 +606,11 @@ void FrameBufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
_fboID.resize(maxSize);
|
||||
_unsupported.resize(maxSize);
|
||||
_fboID.resize(maxSize);
|
||||
|
||||
for(AttachmentMap::iterator itr = _attachments.begin(); itr != _attachments.end(); ++itr)
|
||||
{
|
||||
itr->second.resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
void FrameBufferObject::releaseGLObjects(osg::State* state) const
|
||||
@@ -618,6 +635,11 @@ void FrameBufferObject::releaseGLObjects(osg::State* state) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(AttachmentMap::const_iterator itr = _attachments.begin(); itr != _attachments.end(); ++itr)
|
||||
{
|
||||
itr->second.releaseGLObjects(state);
|
||||
}
|
||||
}
|
||||
|
||||
void FrameBufferObject::setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment)
|
||||
|
||||
@@ -63,10 +63,6 @@ static osg::buffered_object<ExtensionSet> s_glExtensionSetList;
|
||||
static osg::buffered_object<std::string> s_glRendererList;
|
||||
static osg::buffered_value<int> s_glInitializedList;
|
||||
|
||||
static osg::buffered_object<ExtensionSet> s_gluExtensionSetList;
|
||||
static osg::buffered_object<std::string> s_gluRendererList;
|
||||
static osg::buffered_value<int> s_gluInitializedList;
|
||||
|
||||
static ApplicationUsageProxy GLEXtension_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE, "OSG_GL_EXTENSION_DISABLE <value>", "Use space deliminarted list of GL extensions to disable associated GL extensions");
|
||||
static ApplicationUsageProxy GLEXtension_e1(ApplicationUsage::ENVIRONMENTAL_VARIABLE, "OSG_MAX_TEXTURE_SIZE <value>", "Clamp the maximum GL texture size to specified value.");
|
||||
|
||||
@@ -459,7 +455,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
isVertexShaderSupported = validContext && (shadersBuiltIn || osg::isGLExtensionSupported(contextID,"GL_ARB_vertex_shader"));
|
||||
isFragmentShaderSupported = validContext && (shadersBuiltIn || osg::isGLExtensionSupported(contextID,"GL_ARB_fragment_shader"));
|
||||
isLanguage100Supported = validContext && (shadersBuiltIn || osg::isGLExtensionSupported(contextID,"GL_ARB_shading_language_100"));
|
||||
isGeometryShader4Supported = validContext && (osg::isGLExtensionSupported(contextID,"GL_EXT_geometry_shader4") || osg::isGLExtensionSupported(contextID,"GL_OES_geometry_shader") || osg::isGLExtensionOrVersionSupported(contextID,"GL_ARB_geometry_shader4", 3.2f));
|
||||
isGeometryShader4Supported = validContext && (osg::isGLExtensionSupported(contextID,"GL_EXT_geometry_shader4") || osg::isGLExtensionSupported(contextID,"GL_ARB_geometry_shader4"));
|
||||
isGpuShader4Supported = validContext && osg::isGLExtensionOrVersionSupported(contextID,"GL_EXT_gpu_shader4", 3.0f);
|
||||
areTessellationShadersSupported = validContext && (osg::isGLExtensionOrVersionSupported(contextID, "GL_ARB_tessellation_shader", 4.0f) || osg::isGLExtensionSupported(contextID,"GL_OES_tessellation_shader"));
|
||||
isUniformBufferObjectSupported = validContext && osg::isGLExtensionOrVersionSupported(contextID,"GL_ARB_uniform_buffer_object", 3.1f);
|
||||
@@ -1284,6 +1280,13 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
|
||||
}
|
||||
|
||||
GLExtensions::~GLExtensions()
|
||||
{
|
||||
// Remove s_gl*List
|
||||
s_glExtensionSetList[contextID] = ExtensionSet();
|
||||
s_glRendererList[contextID] = std::string();
|
||||
s_glInitializedList[contextID] = 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++-friendly convenience methods
|
||||
|
||||
@@ -62,12 +62,10 @@ GraphicsObjectManager::GraphicsObjectManager(const std::string& name, unsigned i
|
||||
_name(name),
|
||||
_contextID(contextID)
|
||||
{
|
||||
OSG_INFO<<_name<<"::"<<_name<<"()"<<this<<std::endl;
|
||||
}
|
||||
|
||||
GraphicsObjectManager::~GraphicsObjectManager()
|
||||
{
|
||||
OSG_INFO<<_name<<"::~"<<_name<<"()"<<this<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -82,8 +82,17 @@ Geometry::Geometry(const Geometry& geometry,const CopyOp& copyop):
|
||||
|
||||
Geometry::~Geometry()
|
||||
{
|
||||
_stateset = 0;
|
||||
Geometry::releaseGLObjects();
|
||||
// clean up display lists if assigned, and use the GLObjectSizeHint() while prior to it being invalidated by the automatic clean up of arrays that will invalidate the getGLObjectSizeHint() value.
|
||||
#ifdef OSG_GL_DISPLAYLISTS_AVAILABLE
|
||||
for(unsigned int i=0;i<_globjList.size();++i)
|
||||
{
|
||||
if (_globjList[i] != 0)
|
||||
{
|
||||
Drawable::deleteDisplayList(i,_globjList[i], getGLObjectSizeHint());
|
||||
_globjList[i] = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define ARRAY_NOT_EMPTY(array) (array!=0 && array->getNumElements()!=0)
|
||||
|
||||
@@ -438,7 +438,7 @@ bool GraphicsContext::realize()
|
||||
|
||||
void GraphicsContext::close(bool callCloseImplementation)
|
||||
{
|
||||
OSG_INFO<<"close("<<callCloseImplementation<<")"<<this<<std::endl;
|
||||
OSG_INFO<<"GraphicsContext::close("<<callCloseImplementation<<")"<<this<<std::endl;
|
||||
|
||||
// switch off the graphics thread...
|
||||
setGraphicsThread(0);
|
||||
|
||||
@@ -356,14 +356,58 @@ GLenum Image::computePixelFormat(GLenum format)
|
||||
case(GL_LUMINANCE_ALPHA32F_ARB):
|
||||
return GL_LUMINANCE_ALPHA;
|
||||
|
||||
case (GL_R16F):
|
||||
case (GL_R32F):
|
||||
case (GL_R8):
|
||||
case (GL_R8_SNORM):
|
||||
case (GL_R16):
|
||||
case (GL_R16_SNORM):
|
||||
return GL_RED;
|
||||
|
||||
case (GL_R8I):
|
||||
case (GL_R8UI):
|
||||
case (GL_R16I):
|
||||
case (GL_R16UI):
|
||||
case (GL_R32I):
|
||||
case (GL_R32UI):
|
||||
return GL_RED_INTEGER_EXT;
|
||||
|
||||
case (GL_RG16F):
|
||||
case (GL_RG32F):
|
||||
case (GL_RG8):
|
||||
case (GL_RG8_SNORM):
|
||||
case (GL_RG16):
|
||||
case (GL_RG16_SNORM):
|
||||
return GL_RG;
|
||||
|
||||
case (GL_RG8I):
|
||||
case (GL_RG8UI):
|
||||
case (GL_RG16I):
|
||||
case (GL_RG16UI):
|
||||
case (GL_RG32I):
|
||||
case (GL_RG32UI):
|
||||
return GL_RG_INTEGER;
|
||||
|
||||
case(GL_RGB32F_ARB):
|
||||
case(GL_RGB16F_ARB):
|
||||
case(GL_R3_G3_B2):
|
||||
case(GL_RGB4):
|
||||
case(GL_RGB5):
|
||||
case(GL_RGB8):
|
||||
case(GL_RGB8_SNORM):
|
||||
case(GL_RGB10):
|
||||
case(GL_RGB12):
|
||||
case(GL_SRGB8):
|
||||
return GL_RGB;
|
||||
|
||||
case(GL_RGBA8):
|
||||
case(GL_RGBA16):
|
||||
case(GL_RGBA32F_ARB):
|
||||
case(GL_RGBA16F_ARB):
|
||||
case(GL_RGBA8_SNORM):
|
||||
case(GL_RGB10_A2):
|
||||
case(GL_RGBA12):
|
||||
case(GL_SRGB8_ALPHA8):
|
||||
return GL_RGBA;
|
||||
|
||||
case(GL_ALPHA8I_EXT):
|
||||
@@ -535,9 +579,31 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
|
||||
case(GL_ALPHA32UI_EXT): return 1;
|
||||
case(GL_ALPHA16F_ARB): return 1;
|
||||
case(GL_ALPHA32F_ARB): return 1;
|
||||
case(GL_R16F): return 1;
|
||||
case(GL_R32F): return 1;
|
||||
case(GL_R8): return 1;
|
||||
case(GL_R8_SNORM): return 1;
|
||||
case(GL_R16): return 1;
|
||||
case(GL_R16_SNORM): return 1;
|
||||
case(GL_R8I): return 1;
|
||||
case(GL_R8UI): return 1;
|
||||
case(GL_R16I): return 1;
|
||||
case(GL_R16UI): return 1;
|
||||
case(GL_R32I): return 1;
|
||||
case(GL_R32UI): return 1;
|
||||
case(GL_RG): return 2;
|
||||
case(GL_RG16F): return 2;
|
||||
case(GL_RG32F): return 2;
|
||||
case(GL_RG8): return 2;
|
||||
case(GL_RG8_SNORM): return 2;
|
||||
case(GL_RG16): return 2;
|
||||
case(GL_RG16_SNORM): return 2;
|
||||
case(GL_RG8I): return 2;
|
||||
case(GL_RG8UI): return 2;
|
||||
case(GL_RG16I): return 2;
|
||||
case(GL_RG16UI): return 2;
|
||||
case(GL_RG32I): return 2;
|
||||
case(GL_RG32UI): return 2;
|
||||
case(GL_RGB): return 3;
|
||||
case(GL_BGR): return 3;
|
||||
case(GL_RGB8I_EXT): return 3;
|
||||
|
||||
@@ -364,9 +364,7 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const
|
||||
|
||||
}
|
||||
|
||||
|
||||
unsigned int
|
||||
QueryGeometry::getNumPixels( const osg::Camera* cam )
|
||||
QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam )
|
||||
{
|
||||
osg::ref_ptr<osg::TestResult> tr;
|
||||
{
|
||||
@@ -378,13 +376,20 @@ QueryGeometry::getNumPixels( const osg::Camera* cam )
|
||||
_results[ cam ] = tr;
|
||||
}
|
||||
}
|
||||
return tr->_numPixels;
|
||||
return QueryResult((tr->_init && !tr->_active), tr->_numPixels);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
QueryGeometry::getNumPixels( const osg::Camera* cam )
|
||||
{
|
||||
return getQueryResult(cam).numPixels;
|
||||
}
|
||||
|
||||
void
|
||||
QueryGeometry::releaseGLObjects( osg::State* state ) const
|
||||
{
|
||||
Geometry::releaseGLObjects(state);
|
||||
|
||||
if (!state)
|
||||
{
|
||||
// delete all query IDs for all contexts.
|
||||
@@ -437,6 +442,7 @@ QueryGeometry::discardDeletedQueryObjects( unsigned int contextID )
|
||||
|
||||
OcclusionQueryNode::OcclusionQueryNode()
|
||||
: _enabled( true ),
|
||||
_validQueryGeometry( false ),
|
||||
_passed(false),
|
||||
_visThreshold( 500 ),
|
||||
_queryFrameCount( 5 ),
|
||||
@@ -454,6 +460,7 @@ OcclusionQueryNode::~OcclusionQueryNode()
|
||||
|
||||
OcclusionQueryNode::OcclusionQueryNode( const OcclusionQueryNode& oqn, const CopyOp& copyop )
|
||||
: Group( oqn, copyop ),
|
||||
_validQueryGeometry( false ),
|
||||
_passed( false )
|
||||
{
|
||||
_enabled = oqn._enabled;
|
||||
@@ -469,9 +476,27 @@ OcclusionQueryNode::OcclusionQueryNode( const OcclusionQueryNode& oqn, const Cop
|
||||
bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
||||
{
|
||||
if ( !_enabled )
|
||||
{
|
||||
// Queries are not enabled. The caller should be osgUtil::CullVisitor,
|
||||
// return true to traverse the subgraphs.
|
||||
return true;
|
||||
_passed = true;
|
||||
return _passed;
|
||||
}
|
||||
|
||||
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
||||
|
||||
if ( !_validQueryGeometry )
|
||||
{
|
||||
// There're cases that the occlusion test result has been retrieved
|
||||
// after the query geometry has been changed, it's the result of the
|
||||
// geometry before the change.
|
||||
qg->reset();
|
||||
|
||||
// The box of the query geometry is invalid, return false to not traverse
|
||||
// the subgraphs.
|
||||
_passed = false;
|
||||
return _passed;
|
||||
}
|
||||
|
||||
{
|
||||
// Two situations where we want to simply do a regular traversal:
|
||||
@@ -482,16 +507,19 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
||||
const unsigned int& lastQueryFrame( _frameCountMap[ camera ] );
|
||||
if( ( lastQueryFrame == 0 ) ||
|
||||
( (nv.getTraversalNumber() - lastQueryFrame) > (_queryFrameCount + 1) ) )
|
||||
return true;
|
||||
{
|
||||
_passed = true;
|
||||
return _passed;
|
||||
}
|
||||
}
|
||||
|
||||
if (_queryGeode->getDrawable( 0 ) == NULL)
|
||||
{
|
||||
OSG_FATAL << "osgOQ: OcclusionQueryNode: No QueryGeometry." << std::endl;
|
||||
// Something's broke. Return true so we at least render correctly.
|
||||
return true;
|
||||
_passed = true;
|
||||
return _passed;
|
||||
}
|
||||
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
||||
|
||||
// Get the near plane for the upcoming distance calculation.
|
||||
osg::Matrix::value_type nearPlane;
|
||||
@@ -511,8 +539,16 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
||||
_passed = ( distance <= 0.0 );
|
||||
if (!_passed)
|
||||
{
|
||||
int result = qg->getNumPixels( camera );
|
||||
_passed = ( (unsigned int)(result) > _visThreshold );
|
||||
QueryGeometry::QueryResult result = qg->getQueryResult( camera );
|
||||
if (!result.valid)
|
||||
{
|
||||
// The query hasn't finished yet and the result still
|
||||
// isn't available, return true to traverse the subgraphs.
|
||||
_passed = true;
|
||||
return _passed;
|
||||
}
|
||||
|
||||
_passed = ( result.numPixels > _visThreshold );
|
||||
}
|
||||
|
||||
return _passed;
|
||||
@@ -520,6 +556,9 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
||||
|
||||
void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv )
|
||||
{
|
||||
if (!_validQueryGeometry || ! _enabled)
|
||||
return;
|
||||
|
||||
bool issueQuery;
|
||||
{
|
||||
const int curFrame = nv.getTraversalNumber();
|
||||
@@ -536,9 +575,11 @@ void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv )
|
||||
|
||||
void OcclusionQueryNode::traverseDebug( NodeVisitor& nv )
|
||||
{
|
||||
if (_debugBB)
|
||||
if (_debugBB && _enabled)
|
||||
{
|
||||
// If requested, display the debug geometry
|
||||
_debugGeode->accept( nv );
|
||||
}
|
||||
}
|
||||
|
||||
BoundingSphere OcclusionQueryNode::computeBound() const
|
||||
@@ -557,17 +598,28 @@ BoundingSphere OcclusionQueryNode::computeBound() const
|
||||
ComputeBoundsVisitor cbv;
|
||||
nonConstThis->accept( cbv );
|
||||
BoundingBox bb = cbv.getBoundingBox();
|
||||
const bool bbValid = bb.valid();
|
||||
_validQueryGeometry = bbValid;
|
||||
|
||||
osg::ref_ptr<Vec3Array> v = new Vec3Array;
|
||||
v->resize( 8 );
|
||||
(*v)[0] = Vec3( bb._min.x(), bb._min.y(), bb._min.z() );
|
||||
(*v)[1] = Vec3( bb._max.x(), bb._min.y(), bb._min.z() );
|
||||
(*v)[2] = Vec3( bb._max.x(), bb._min.y(), bb._max.z() );
|
||||
(*v)[3] = Vec3( bb._min.x(), bb._min.y(), bb._max.z() );
|
||||
(*v)[4] = Vec3( bb._max.x(), bb._max.y(), bb._min.z() );
|
||||
(*v)[5] = Vec3( bb._min.x(), bb._max.y(), bb._min.z() );
|
||||
(*v)[6] = Vec3( bb._min.x(), bb._max.y(), bb._max.z() );
|
||||
(*v)[7] = Vec3( bb._max.x(), bb._max.y(), bb._max.z() );
|
||||
|
||||
// Having (0,0,0) as vertices for the case of the invalid query geometry
|
||||
// still isn't quite the right thing. But the query geometry is public
|
||||
// accessible and therefore a user might expect eight vertices, so
|
||||
// it seems safer to keep eight vertices in the geometry.
|
||||
|
||||
if (bbValid)
|
||||
{
|
||||
(*v)[0] = Vec3( bb._min.x(), bb._min.y(), bb._min.z() );
|
||||
(*v)[1] = Vec3( bb._max.x(), bb._min.y(), bb._min.z() );
|
||||
(*v)[2] = Vec3( bb._max.x(), bb._min.y(), bb._max.z() );
|
||||
(*v)[3] = Vec3( bb._min.x(), bb._min.y(), bb._max.z() );
|
||||
(*v)[4] = Vec3( bb._max.x(), bb._max.y(), bb._min.z() );
|
||||
(*v)[5] = Vec3( bb._min.x(), bb._max.y(), bb._min.z() );
|
||||
(*v)[6] = Vec3( bb._min.x(), bb._max.y(), bb._max.z() );
|
||||
(*v)[7] = Vec3( bb._max.x(), bb._max.y(), bb._max.z() );
|
||||
}
|
||||
|
||||
Geometry* geom = static_cast< Geometry* >( nonConstThis->_queryGeode->getDrawable( 0 ) );
|
||||
geom->setVertexArray( v.get() );
|
||||
@@ -586,6 +638,12 @@ void OcclusionQueryNode::setQueriesEnabled( bool enable )
|
||||
_enabled = enable;
|
||||
}
|
||||
|
||||
void OcclusionQueryNode::resetQueries()
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _frameCountMutex );
|
||||
_frameCountMap.clear();
|
||||
}
|
||||
|
||||
// Should only be called outside of cull/draw. No thread issues.
|
||||
void OcclusionQueryNode::setDebugDisplay( bool debug )
|
||||
{
|
||||
|
||||
@@ -2752,7 +2752,7 @@ Texture::GenerateMipmapMode Texture::mipmapBeforeTexImage(const State& state, bo
|
||||
if (useGenerateMipMap) return GENERATE_MIPMAP;
|
||||
}
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
|
||||
glTexParameteri(getTextureTarget(), GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
|
||||
return GENERATE_MIPMAP_TEX_PARAMETER;
|
||||
#endif
|
||||
}
|
||||
@@ -2775,7 +2775,7 @@ void Texture::mipmapAfterTexImage(State& state, GenerateMipmapMode beforeResult)
|
||||
break;
|
||||
}
|
||||
case GENERATE_MIPMAP_TEX_PARAMETER:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
|
||||
glTexParameteri(getTextureTarget(), GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
|
||||
break;
|
||||
case GENERATE_MIPMAP_NONE:
|
||||
break;
|
||||
|
||||
@@ -123,7 +123,7 @@ void Uniform::setNumElements( unsigned int numElements )
|
||||
void Uniform::allocateDataArray()
|
||||
{
|
||||
// if one array is already allocated, the job is done.
|
||||
if( _floatArray.valid() || _doubleArray.valid() || _intArray.valid() || _uintArray.valid() ) return;
|
||||
if( _floatArray.valid() || _doubleArray.valid() || _intArray.valid() || _uintArray.valid() || _int64Array.valid() || _uint64Array.valid()) return;
|
||||
|
||||
// array cannot be created until _type and _numElements are specified
|
||||
int arrayNumElements = getInternalArrayNumElements();
|
||||
@@ -147,6 +147,14 @@ void Uniform::allocateDataArray()
|
||||
_uintArray = new UIntArray(arrayNumElements);
|
||||
return;
|
||||
|
||||
case GL_INT64_ARB:
|
||||
_int64Array = new Int64Array(arrayNumElements);
|
||||
return;
|
||||
|
||||
case GL_UNSIGNED_INT64_ARB:
|
||||
_uint64Array = new UInt64Array(arrayNumElements);
|
||||
return;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -241,7 +249,7 @@ bool Uniform::setArray( UInt64Array* array )
|
||||
if( !array ) return false;
|
||||
|
||||
// incoming array must match configuration of the Uniform
|
||||
if( getInternalArrayType(getType())!=GL_UNSIGNED_INT || getInternalArrayNumElements()!=array->getNumElements() )
|
||||
if( getInternalArrayType(getType())!=GL_UNSIGNED_INT64_ARB || getInternalArrayNumElements()!=array->getNumElements() )
|
||||
{
|
||||
OSG_WARN << "Uniform::setArray : incompatible array" << std::endl;
|
||||
return false;
|
||||
@@ -262,7 +270,7 @@ bool Uniform::setArray( Int64Array* array )
|
||||
if( !array ) return false;
|
||||
|
||||
// incoming array must match configuration of the Uniform
|
||||
if( getInternalArrayType(getType())!=GL_UNSIGNED_INT || getInternalArrayNumElements()!=array->getNumElements() )
|
||||
if( getInternalArrayType(getType())!=GL_UNSIGNED_INT64_ARB || getInternalArrayNumElements()!=array->getNumElements() )
|
||||
{
|
||||
OSG_WARN << "Uniform::setArray : incompatible array" << std::endl;
|
||||
return false;
|
||||
|
||||
@@ -488,7 +488,7 @@ struct VertexAttribArrayDispatch : public VertexArrayState::ArrayDispatch
|
||||
virtual void enable_and_dispatch(osg::State& state, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized)
|
||||
{
|
||||
GLExtensions* ext = state.get<GLExtensions>();
|
||||
|
||||
|
||||
ext->glEnableVertexAttribArray( unit );
|
||||
ext->glVertexAttribPointer(static_cast<GLuint>(unit), size, type, normalized, stride, ptr);
|
||||
}
|
||||
@@ -526,10 +526,19 @@ VertexArrayState::VertexArrayState(osg::State* state):
|
||||
_currentEBO(0),
|
||||
_requiresSetArrays(true)
|
||||
{
|
||||
_stateObserverSet = _state->getOrCreateObserverSet();
|
||||
_ext = _state->get<GLExtensions>();
|
||||
_isVertexBufferObjectSupported = _ext->isBufferObjectSupported;
|
||||
}
|
||||
|
||||
VertexArrayState::~VertexArrayState()
|
||||
{
|
||||
if (_stateObserverSet->getObserverdObject())
|
||||
{
|
||||
_state->resetCurrentVertexArrayStateOnMatch(this);
|
||||
}
|
||||
}
|
||||
|
||||
void VertexArrayState::generateVertexArrayObject()
|
||||
{
|
||||
_ext->glGenVertexArrays(1, &_vertexArrayObject);
|
||||
@@ -539,10 +548,10 @@ void VertexArrayState::deleteVertexArrayObject()
|
||||
{
|
||||
if (_vertexArrayObject)
|
||||
{
|
||||
VAS_NOTICE<<" VertexArrayState::deleteVertexArrayObject() "<<_vertexArrayObject<<std::endl;
|
||||
VAS_NOTICE<<" VertexArrayState::deleteVertexArrayObject() "<<_vertexArrayObject<<" "<<_stateObserverSet->getObserverdObject()<<std::endl;
|
||||
|
||||
_ext->glDeleteVertexArrays(1, &_vertexArrayObject);
|
||||
_vertexArrayObject = 0;
|
||||
//_vertexArrayObject = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +562,19 @@ bool VertexArrayState::correctArrayDispatchAssigned(const ArrayDispatch* ad)
|
||||
#else
|
||||
return ad!=0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
VertexArrayState::ArrayDispatch* getOrCreateVertexAttributeDispatch(VertexArrayState::ArrayDispatchList& list, int slot)
|
||||
{
|
||||
list.resize(slot + 1);
|
||||
osg::ref_ptr<VertexArrayState::ArrayDispatch>& ad = list[slot];
|
||||
if (!ad.valid())
|
||||
ad = new VertexAttribArrayDispatch(slot);
|
||||
|
||||
return ad.get();
|
||||
}
|
||||
}// anonymous namespace
|
||||
|
||||
void VertexArrayState::assignVertexArrayDispatcher()
|
||||
{
|
||||
@@ -567,9 +588,9 @@ void VertexArrayState::assignVertexArrayDispatcher()
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (_vertexArray.valid()) return;
|
||||
VAS_NOTICE<<"VertexArrayState::assignVertexArrayDispatcher() _state->getVertexAlias()._location="<<_state->getVertexAlias()._location<<std::endl;
|
||||
_vertexArray = new VertexAttribArrayDispatch(_state->getVertexAlias()._location);
|
||||
int slot = _state->getVertexAlias()._location;
|
||||
VAS_NOTICE << "VertexArrayState::assignVertexArrayDispatcher() _state->getVertexAlias()._location = " << slot << std::endl;
|
||||
_vertexArray = getOrCreateVertexAttributeDispatch(_vertexAttribArrays, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,8 +606,9 @@ void VertexArrayState::assignNormalArrayDispatcher()
|
||||
else
|
||||
#endif
|
||||
{
|
||||
VAS_NOTICE<<"VertexArrayState::assignNormalArrayDispatcher() _state->getNormalAlias()._location="<<_state->getNormalAlias()._location<<std::endl;
|
||||
_normalArray = new VertexAttribArrayDispatch(_state->getNormalAlias()._location);
|
||||
int slot = _state->getNormalAlias()._location;
|
||||
VAS_NOTICE << "VertexArrayState::assignNormalArrayDispatcher() _state->getNormalAlias()._location = " << slot << std::endl;
|
||||
_normalArray = getOrCreateVertexAttributeDispatch(_vertexAttribArrays, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,8 +624,9 @@ void VertexArrayState::assignColorArrayDispatcher()
|
||||
else
|
||||
#endif
|
||||
{
|
||||
VAS_NOTICE<<"VertexArrayState::assignColorArrayDispatcher() _state->getColorAlias()._location="<<_state->getColorAlias()._location<<std::endl;
|
||||
_colorArray = new VertexAttribArrayDispatch(_state->getColorAlias()._location);
|
||||
int slot = _state->getColorAlias()._location;
|
||||
VAS_NOTICE << "VertexArrayState::assignColorArrayDispatcher() _state->getColorAlias()._location = " << slot << std::endl;
|
||||
_colorArray = getOrCreateVertexAttributeDispatch(_vertexAttribArrays, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,7 +642,9 @@ void VertexArrayState::assignSecondaryColorArrayDispatcher()
|
||||
else
|
||||
#endif
|
||||
{
|
||||
_secondaryColorArray = new VertexAttribArrayDispatch(_state->getSecondaryColorAlias()._location);
|
||||
int slot = _state->getSecondaryColorAlias()._location;
|
||||
VAS_NOTICE << "VertexArrayState::assignSecondaryColorArrayDispatcher() _state->getSecondaryColorAlias()._location = " << slot << std::endl;
|
||||
_secondaryColorArray = getOrCreateVertexAttributeDispatch(_vertexAttribArrays, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,7 +660,9 @@ void VertexArrayState::assignFogCoordArrayDispatcher()
|
||||
else
|
||||
#endif
|
||||
{
|
||||
_fogCoordArray = new VertexAttribArrayDispatch(_state->getFogCoordAlias()._location);
|
||||
int slot = _state->getFogCoordAlias()._location;
|
||||
VAS_NOTICE << "VertexArrayState::assignFogCoordArrayDispatcher() _state->getFogCoordAlias()._location = " << slot << std::endl;
|
||||
_fogCoordArray = getOrCreateVertexAttributeDispatch(_vertexAttribArrays, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,7 +682,9 @@ void VertexArrayState::assignTexCoordArrayDispatcher(unsigned int numUnits)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
_texCoordArrays[i] = new VertexAttribArrayDispatch(_state->getTexCoordAliasList()[i]._location);
|
||||
int slot = _state->getTexCoordAliasList()[i]._location;
|
||||
VAS_NOTICE << "VertexArrayState::assignTexCoordArrayDispatcher() _state->getTexCoordAliasList()[" << i << "]._location = " << slot << std::endl;
|
||||
_texCoordArrays[i] = getOrCreateVertexAttributeDispatch(_vertexAttribArrays, slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -677,13 +706,14 @@ void VertexArrayState::assignAllDispatchers()
|
||||
unsigned int numUnits = 8;
|
||||
unsigned int numVertexAttrib = 16;
|
||||
|
||||
assignVertexAttribArrayDispatcher(numVertexAttrib);
|
||||
|
||||
assignVertexArrayDispatcher();
|
||||
assignNormalArrayDispatcher();
|
||||
assignColorArrayDispatcher();
|
||||
assignSecondaryColorArrayDispatcher();
|
||||
assignFogCoordArrayDispatcher();
|
||||
assignTexCoordArrayDispatcher(numUnits);
|
||||
assignVertexAttribArrayDispatcher(numVertexAttrib);
|
||||
}
|
||||
|
||||
void VertexArrayState::release()
|
||||
|
||||
@@ -222,3 +222,26 @@ unsigned int View::findSlaveIndexForCamera(osg::Camera* camera) const
|
||||
return _slaves.size();
|
||||
}
|
||||
|
||||
void View::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_camera) _camera->resizeGLObjectBuffers(maxSize);
|
||||
|
||||
for(Slaves::iterator itr = _slaves.begin();
|
||||
itr != _slaves.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->_camera.valid()) itr->_camera->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
void View::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
if (_camera) _camera->releaseGLObjects(state);
|
||||
|
||||
for(Slaves::const_iterator itr = _slaves.begin();
|
||||
itr != _slaves.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->_camera.valid()) itr->_camera->releaseGLObjects(state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,7 @@ void StackedTransform::update(float t)
|
||||
continue;
|
||||
// update and check if there are changes
|
||||
element->update(t);
|
||||
if (!dirty && !element->isIdentity()){
|
||||
dirty = true;
|
||||
}
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
if (!dirty)
|
||||
|
||||
@@ -126,7 +126,7 @@ SET(TARGET_SRC
|
||||
)
|
||||
|
||||
IF(APPLE AND NOT ANDROID)
|
||||
IF(NOT OSG_BUILD_PLATFORM_IPHONE AND NOT OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
IF(NOT OSG_BUILD_PLATFORM_IPHONE)
|
||||
# Needs CoreFoundation calls and a Carbon function
|
||||
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
@@ -49,57 +49,6 @@ static osg::ApplicationUsageProxy DatabasePager_e4(osg::ApplicationUsage::ENVIRO
|
||||
static osg::ApplicationUsageProxy DatabasePager_e11(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_PAGEDLOD <num>","Set the target maximum number of PagedLOD to maintain.");
|
||||
static osg::ApplicationUsageProxy DatabasePager_e12(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_ASSIGN_PBO_TO_IMAGES <ON/OFF>","Set whether PixelBufferObjects should be assigned to Images to aid download to the GPU.");
|
||||
|
||||
// Convert function objects that take pointer args into functions that a
|
||||
// reference to an osg::ref_ptr. This is quite useful for doing STL
|
||||
// operations on lists of ref_ptr. This code assumes that a function
|
||||
// with an argument const Foo* should be composed into a function of
|
||||
// argument type ref_ptr<Foo>&, not ref_ptr<const Foo>&. Some support
|
||||
// for that should be added to make this more general.
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename U>
|
||||
struct PointerTraits
|
||||
{
|
||||
typedef class NullType {} PointeeType;
|
||||
};
|
||||
|
||||
template <typename U>
|
||||
struct PointerTraits<U*>
|
||||
{
|
||||
typedef U PointeeType;
|
||||
};
|
||||
|
||||
template <typename U>
|
||||
struct PointerTraits<const U*>
|
||||
{
|
||||
typedef U PointeeType;
|
||||
};
|
||||
|
||||
template <typename FuncObj>
|
||||
class RefPtrAdapter
|
||||
: public std::unary_function<const osg::ref_ptr<typename PointerTraits<typename FuncObj::argument_type>::PointeeType>,
|
||||
typename FuncObj::result_type>
|
||||
{
|
||||
public:
|
||||
typedef typename PointerTraits<typename FuncObj::argument_type>::PointeeType PointeeType;
|
||||
typedef osg::ref_ptr<PointeeType> RefPtrType;
|
||||
explicit RefPtrAdapter(const FuncObj& funcObj) : _func(funcObj) {}
|
||||
typename FuncObj::result_type operator()(const RefPtrType& refPtr) const
|
||||
{
|
||||
return _func(refPtr.get());
|
||||
}
|
||||
protected:
|
||||
FuncObj _func;
|
||||
};
|
||||
|
||||
template <typename FuncObj>
|
||||
RefPtrAdapter<FuncObj> refPtrAdapt(const FuncObj& func)
|
||||
{
|
||||
return RefPtrAdapter<FuncObj>(func);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -1714,12 +1663,6 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
||||
registerPagedLODs(databaseRequest->_loadedModel.get(), frameNumber);
|
||||
}
|
||||
|
||||
if (databaseRequest->_objectCache.valid() && osgDB::Registry::instance()->getObjectCache())
|
||||
{
|
||||
// insert loaded model into Registry ObjectCache
|
||||
osgDB::Registry::instance()->getObjectCache()->addObjectCache( databaseRequest->_objectCache.get());
|
||||
}
|
||||
|
||||
// OSG_NOTICE<<"merged subgraph"<<databaseRequest->_fileName<<" after "<<databaseRequest->_numOfRequests<<" requests and time="<<(timeStamp-databaseRequest->_timestampFirstRequest)*1000.0<<std::endl;
|
||||
|
||||
double timeToMerge = timeStamp-databaseRequest->_timestampFirstRequest;
|
||||
@@ -1735,6 +1678,13 @@ void DatabasePager::addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp)
|
||||
OSG_INFO<<"DatabasePager::addLoadedDataToSceneGraph() node in parental chain deleted, discarding subgaph."<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
if (databaseRequest->_objectCache.valid() && osgDB::Registry::instance()->getObjectCache())
|
||||
{
|
||||
// insert loaded model into Registry ObjectCache
|
||||
osgDB::Registry::instance()->getObjectCache()->addObjectCache( databaseRequest->_objectCache.get());
|
||||
databaseRequest->_objectCache->clear();
|
||||
}
|
||||
// reset the loadedModel pointer
|
||||
databaseRequest->_loadedModel = 0;
|
||||
|
||||
|
||||
@@ -113,6 +113,11 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
|
||||
return handle;
|
||||
#else // other unix
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
// Library can be found in APK/lib/armeabi-v7a etc.
|
||||
// Should not be prefaced with './'
|
||||
std::string localLibraryName = libraryName;
|
||||
#else
|
||||
// dlopen will not work with files in the current directory unless
|
||||
// they are prefaced with './' (DB - Nov 5, 2003).
|
||||
std::string localLibraryName;
|
||||
@@ -120,6 +125,7 @@ DynamicLibrary::HANDLE DynamicLibrary::getLibraryHandle( const std::string& libr
|
||||
localLibraryName = "./" + libraryName;
|
||||
else
|
||||
localLibraryName = libraryName;
|
||||
#endif
|
||||
|
||||
handle = dlopen( localLibraryName.c_str(), RTLD_LAZY | RTLD_GLOBAL);
|
||||
if( handle == NULL )
|
||||
|
||||
@@ -342,6 +342,11 @@ std::string osgDB::findFileInPath(const std::string& filename, const FilePathLis
|
||||
OSG_DEBUG << "itr='" <<*itr<< "'\n";
|
||||
std::string path = itr->empty() ? filename : concatPaths(*itr, filename);
|
||||
|
||||
#ifdef WIN32
|
||||
// if combined file path exceeds MAX_PATH then ignore as it's not a legal path otherwise subsequent IO calls with this path may result in undefined behavior
|
||||
if (path.length()>MAX_PATH) continue;
|
||||
#endif
|
||||
|
||||
path = getRealPath(path);
|
||||
|
||||
OSG_DEBUG << "FindFileInPath() : trying " << path << " ...\n";
|
||||
|
||||
@@ -187,7 +187,10 @@ InputStream& InputStream::operator>>( osg::Vec4d& v )
|
||||
|
||||
|
||||
InputStream& InputStream::operator>>( osg::Quat& q )
|
||||
{ *this >> q.x() >> q.y() >> q.z() >> q.w(); return *this; }
|
||||
{
|
||||
double x, y, z, w; *this >> x >> y >> z >> w;
|
||||
q.set( x, y, z, w ); return *this;
|
||||
}
|
||||
|
||||
InputStream& InputStream::operator>>( osg::Plane& p )
|
||||
{
|
||||
|
||||
@@ -172,7 +172,7 @@ OutputStream& OutputStream::operator<<( const osg::Vec4ui& v )
|
||||
|
||||
|
||||
OutputStream& OutputStream::operator<<( const osg::Quat& q )
|
||||
{ *this << q.x() << q.y() << q.z() << q.w(); return *this; }
|
||||
{ *this << (double)q.x() << (double)q.y() << (double)q.z() << (double)q.w(); return *this; }
|
||||
|
||||
OutputStream& OutputStream::operator<<( const osg::Plane& p )
|
||||
{ *this << (double)p[0] << (double)p[1] << (double)p[2] << (double)p[3]; return *this; }
|
||||
@@ -925,24 +925,31 @@ template<typename T>
|
||||
void OutputStream::writeArrayImplementation( const T* a, int write_size, unsigned int numInRow )
|
||||
{
|
||||
*this << write_size << BEGIN_BRACKET;
|
||||
if ( numInRow>1 )
|
||||
if ( isBinary() )
|
||||
{
|
||||
for ( int i=0; i<write_size; ++i )
|
||||
{
|
||||
if ( !(i%numInRow) )
|
||||
{
|
||||
*this << std::endl << (*a)[i];
|
||||
}
|
||||
else
|
||||
*this << (*a)[i];
|
||||
}
|
||||
*this << std::endl;
|
||||
if (write_size) writeCharArray((char*)&((*a)[0]), write_size * sizeof((*a)[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
*this << std::endl;
|
||||
for ( int i=0; i<write_size; ++i )
|
||||
*this << (*a)[i] << std::endl;
|
||||
if ( numInRow>1 )
|
||||
{
|
||||
for ( int i=0; i<write_size; ++i )
|
||||
{
|
||||
if ( !(i%numInRow) )
|
||||
{
|
||||
*this << std::endl << (*a)[i];
|
||||
}
|
||||
else
|
||||
*this << (*a)[i];
|
||||
}
|
||||
*this << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
*this << std::endl;
|
||||
for ( int i=0; i<write_size; ++i )
|
||||
*this << (*a)[i] << std::endl;
|
||||
}
|
||||
}
|
||||
*this << END_BRACKET << std::endl;
|
||||
}
|
||||
|
||||
@@ -288,6 +288,9 @@ Registry::Registry()
|
||||
addFileExtensionAlias("terrain", "osgterrain");
|
||||
addFileExtensionAlias("view", "osgviewer");
|
||||
|
||||
//addFileExtensionAlias("vsga", "vsg");
|
||||
//addFileExtensionAlias("vsgb", "vsg");
|
||||
|
||||
addFileExtensionAlias("sgi", "rgb");
|
||||
addFileExtensionAlias("rgba", "rgb");
|
||||
addFileExtensionAlias("int", "rgb");
|
||||
|
||||
@@ -135,6 +135,20 @@ void Effect::traverse(osg::NodeVisitor& nv)
|
||||
// wow, we're finished! :)
|
||||
}
|
||||
|
||||
void Effect::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
Group::resizeGLObjectBuffers(maxSize);
|
||||
if (_dummy_for_validation) _dummy_for_validation->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
void Effect::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
Group::releaseGLObjects(state);
|
||||
if (_dummy_for_validation) _dummy_for_validation->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Effect::build_dummy_node()
|
||||
{
|
||||
_dummy_for_validation = new osg::Geode;
|
||||
|
||||
@@ -186,8 +186,7 @@ void AnimationPathManipulator::handleFrame( double time )
|
||||
{
|
||||
double delta = time-_realStartOfTimedPeriod;
|
||||
double frameRate = (double)_numOfFramesSinceStartOfTimedPeriod/delta;
|
||||
OSG_NOTICE <<"AnimatonPath completed in "<<delta<<" seconds, completing "<<_numOfFramesSinceStartOfTimedPeriod<<" frames,"<<std::endl;
|
||||
OSG_NOTICE <<" average frame rate = "<<frameRate<<std::endl;
|
||||
OSG_NOTICE <<"AnimatonPath completed in "<<delta<<" seconds, completing "<<_numOfFramesSinceStartOfTimedPeriod<<" frames, average frame rate = "<<frameRate<<std::endl;
|
||||
}
|
||||
|
||||
// reset counters for next loop.
|
||||
|
||||
@@ -96,8 +96,10 @@ void CameraManipulator::computeHomePosition(const osg::Camera *camera, bool useB
|
||||
OSG_INFO<<" boundingSphere.center() = ("<<boundingSphere.center()<<")"<<std::endl;
|
||||
OSG_INFO<<" boundingSphere.radius() = "<<boundingSphere.radius()<<std::endl;
|
||||
|
||||
double radius = osg::maximum(double(boundingSphere.radius()), 1e-6);
|
||||
|
||||
// set dist to default
|
||||
double dist = 3.5f * boundingSphere.radius();
|
||||
double dist = 3.5f * radius;
|
||||
|
||||
if (camera)
|
||||
{
|
||||
@@ -110,7 +112,7 @@ void CameraManipulator::computeHomePosition(const osg::Camera *camera, bool useB
|
||||
double horizontal2 = fabs(top - bottom) / zNear / 2.;
|
||||
double dim = horizontal2 < vertical2 ? horizontal2 : vertical2;
|
||||
double viewAngle = atan2(dim,1.);
|
||||
dist = boundingSphere.radius() / sin(viewAngle);
|
||||
dist = radius / sin(viewAngle);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ void GUIEventAdapter::setWindowRectangle(int x, int y, int width, int height, bo
|
||||
|
||||
if (updateMouseRange)
|
||||
{
|
||||
setInputRange(0, 0, width, height);
|
||||
setInputRange(0, 0, width - 1, height - 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ osg::Quat SpherePlaneProjector::getRotation(const osg::Vec3d& p1, bool p1OnSpher
|
||||
osg::Quat rotation;
|
||||
rotation.makeRotate(p1 - getSphere()->getCenter(), p2 - getSphere()->getCenter());
|
||||
|
||||
osg::Vec3d axis; double angle;
|
||||
osg::Vec3d axis; osg::Quat::value_type angle;
|
||||
rotation.getRotate(angle, axis);
|
||||
|
||||
osg::Vec3d realAxis;
|
||||
|
||||
@@ -59,12 +59,8 @@ void osgParticle::ParticleProcessor::setParticleSystem(ParticleSystem* ps)
|
||||
|
||||
void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
// typecast the NodeVisitor to CullVisitor
|
||||
osgUtil::CullVisitor* cv = nv.asCullVisitor();
|
||||
|
||||
// continue only if the visitor actually is a cull visitor
|
||||
if (cv) {
|
||||
|
||||
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR) {
|
||||
// continue only if the particle system is valid
|
||||
if (_ps.valid())
|
||||
{
|
||||
|
||||
@@ -174,7 +174,7 @@ void osgParticle::ParticleSystem::update(double dt, osg::NodeVisitor& nv)
|
||||
osgUtil::CullVisitor* cv = nv.asCullVisitor();
|
||||
if (cv)
|
||||
{
|
||||
osg::Matrixd modelview = *(cv->getModelViewMatrix());
|
||||
osg::Matrix modelview = *(cv->getModelViewMatrix());
|
||||
double scale = (_sortMode==SORT_FRONT_TO_BACK ? -1.0 : 1.0);
|
||||
double deadDistance = DBL_MAX;
|
||||
for (unsigned int i=0; i<_particles.size(); ++i)
|
||||
@@ -659,6 +659,8 @@ osg::BoundingBox osgParticle::ParticleSystem::computeBoundingBox() const
|
||||
|
||||
void osgParticle::ParticleSystem::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
Drawable::resizeGLObjectBuffers(maxSize);
|
||||
|
||||
_bufferedArrayData.resize(maxSize);
|
||||
for(unsigned int i=0; i<_bufferedArrayData.size(); ++i)
|
||||
{
|
||||
@@ -668,6 +670,8 @@ void osgParticle::ParticleSystem::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
|
||||
void osgParticle::ParticleSystem::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
Drawable::releaseGLObjects(state);
|
||||
|
||||
if (state)
|
||||
{
|
||||
_bufferedArrayData[state->getContextID()].releaseGLObjects(state);
|
||||
@@ -681,7 +685,7 @@ void osgParticle::ParticleSystem::releaseGLObjects(osg::State* state) const
|
||||
}
|
||||
}
|
||||
|
||||
osg::VertexArrayState* osgParticle::ParticleSystem::createVertexArrayStateImplemenation(osg::RenderInfo& renderInfo) const
|
||||
osg::VertexArrayState* osgParticle::ParticleSystem::createVertexArrayStateImplementation(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
osg::State& state = *renderInfo.getState();
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ osgParticle::ParticleSystemUpdater::ParticleSystemUpdater(const ParticleSystemUp
|
||||
|
||||
void osgParticle::ParticleSystemUpdater::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
osgUtil::CullVisitor* cv = nv.asCullVisitor();
|
||||
if (cv)
|
||||
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
if (nv.getFrameStamp())
|
||||
{
|
||||
|
||||
@@ -121,22 +121,64 @@ void PrecipitationEffect::snow(float intensity)
|
||||
|
||||
void PrecipitationEffect::compileGLObjects(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
if (_quadGeometry.valid())
|
||||
{
|
||||
_quadGeometry->compileGLObjects(renderInfo);
|
||||
if (_quadGeometry->getStateSet()) _quadGeometry->getStateSet()->compileGLObjects(*renderInfo.getState());
|
||||
}
|
||||
if (_quadGeometry.valid()) _quadGeometry->compileGLObjects(renderInfo);
|
||||
if (_lineGeometry.valid()) _lineGeometry->compileGLObjects(renderInfo);
|
||||
if (_pointGeometry.valid()) _pointGeometry->compileGLObjects(renderInfo);
|
||||
|
||||
if (_lineGeometry.valid())
|
||||
{
|
||||
_lineGeometry->compileGLObjects(renderInfo);
|
||||
if (_lineGeometry->getStateSet()) _lineGeometry->getStateSet()->compileGLObjects(*renderInfo.getState());
|
||||
}
|
||||
if (_quadStateSet.valid()) _quadStateSet->compileGLObjects(*renderInfo.getState());
|
||||
if (_lineStateSet.valid()) _lineStateSet->compileGLObjects(*renderInfo.getState());
|
||||
if (_pointStateSet.valid()) _pointStateSet->compileGLObjects(*renderInfo.getState());
|
||||
|
||||
if (_pointGeometry.valid())
|
||||
for(ViewDrawableMap::const_iterator itr = _viewDrawableMap.begin();
|
||||
itr != _viewDrawableMap.end();
|
||||
++itr)
|
||||
{
|
||||
_pointGeometry->compileGLObjects(renderInfo);
|
||||
if (_pointGeometry->getStateSet()) _pointGeometry->getStateSet()->compileGLObjects(*renderInfo.getState());
|
||||
const PrecipitationDrawableSet& pds = itr->second;
|
||||
if (pds._quadPrecipitationDrawable.valid()) pds._quadPrecipitationDrawable->compileGLObjects(renderInfo);
|
||||
if (pds._linePrecipitationDrawable.valid()) pds._linePrecipitationDrawable->compileGLObjects(renderInfo);
|
||||
if (pds._pointPrecipitationDrawable.valid()) pds._pointPrecipitationDrawable->compileGLObjects(renderInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void PrecipitationEffect::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
if (_quadGeometry.valid()) _quadGeometry->resizeGLObjectBuffers(maxSize);
|
||||
if (_lineGeometry.valid()) _lineGeometry->resizeGLObjectBuffers(maxSize);
|
||||
if (_pointGeometry.valid()) _pointGeometry->resizeGLObjectBuffers(maxSize);
|
||||
|
||||
if (_quadStateSet.valid()) _quadStateSet->resizeGLObjectBuffers(maxSize);
|
||||
if (_lineStateSet.valid()) _lineStateSet->resizeGLObjectBuffers(maxSize);
|
||||
if (_pointStateSet.valid()) _pointStateSet->resizeGLObjectBuffers(maxSize);
|
||||
|
||||
for(ViewDrawableMap::const_iterator itr = _viewDrawableMap.begin();
|
||||
itr != _viewDrawableMap.end();
|
||||
++itr)
|
||||
{
|
||||
const PrecipitationDrawableSet& pds = itr->second;
|
||||
if (pds._quadPrecipitationDrawable.valid()) pds._quadPrecipitationDrawable->resizeGLObjectBuffers(maxSize);
|
||||
if (pds._linePrecipitationDrawable.valid()) pds._linePrecipitationDrawable->resizeGLObjectBuffers(maxSize);
|
||||
if (pds._pointPrecipitationDrawable.valid()) pds._pointPrecipitationDrawable->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
void PrecipitationEffect::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
if (_quadGeometry.valid()) _quadGeometry->releaseGLObjects(state);
|
||||
if (_lineGeometry.valid()) _lineGeometry->releaseGLObjects(state);
|
||||
if (_pointGeometry.valid()) _pointGeometry->releaseGLObjects(state);
|
||||
|
||||
if (_quadStateSet.valid()) _quadStateSet->releaseGLObjects(state);
|
||||
if (_lineStateSet.valid()) _lineStateSet->releaseGLObjects(state);
|
||||
if (_pointStateSet.valid()) _pointStateSet->releaseGLObjects(state);
|
||||
|
||||
for(ViewDrawableMap::const_iterator itr = _viewDrawableMap.begin();
|
||||
itr != _viewDrawableMap.end();
|
||||
++itr)
|
||||
{
|
||||
const PrecipitationDrawableSet& pds = itr->second;
|
||||
if (pds._quadPrecipitationDrawable.valid()) pds._quadPrecipitationDrawable->releaseGLObjects(state);
|
||||
if (pds._linePrecipitationDrawable.valid()) pds._linePrecipitationDrawable->releaseGLObjects(state);
|
||||
if (pds._pointPrecipitationDrawable.valid()) pds._pointPrecipitationDrawable->releaseGLObjects(state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,7 +871,24 @@ PrecipitationEffect::PrecipitationDrawable::PrecipitationDrawable(const Precipit
|
||||
{
|
||||
}
|
||||
|
||||
PrecipitationEffect::PrecipitationDrawable::~PrecipitationDrawable()
|
||||
{
|
||||
OSG_NOTICE<<"PrecipitationEffect::~PrecipitationDrawable() "<<this<<std::endl;
|
||||
}
|
||||
|
||||
void PrecipitationEffect::PrecipitationDrawable::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
Drawable::resizeGLObjectBuffers(maxSize);
|
||||
|
||||
if (_geometry) _geometry->resizeGLObjectBuffers(maxSize);
|
||||
}
|
||||
|
||||
void PrecipitationEffect::PrecipitationDrawable::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
Drawable::releaseGLObjects(state);
|
||||
|
||||
if (_geometry) _geometry->releaseGLObjects(state);
|
||||
}
|
||||
|
||||
void PrecipitationEffect::PrecipitationDrawable::drawImplementation(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
|
||||
@@ -92,6 +92,11 @@ class ReaderWriter3DC : public osgDB::ReaderWriter
|
||||
|
||||
virtual const char* className() const { return "3DC point cloud reader"; }
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension(file);
|
||||
|
||||
@@ -171,7 +171,18 @@ public:
|
||||
|
||||
virtual const char* className() const { return "3DS Auto Studio Reader/Writer"; }
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options* options) const;
|
||||
virtual ReadResult readObject(std::istream& fin, const Options* options) const
|
||||
{
|
||||
return readNode(fin, options);
|
||||
}
|
||||
|
||||
|
||||
virtual ReadResult readNode(std::istream& fin, const Options* options) const;
|
||||
virtual ReadResult doReadNode(std::istream& fin, const Options* options, const std::string & fileNamelib3ds) const; ///< Subfunction of readNode()s functions.
|
||||
|
||||
|
||||
@@ -161,10 +161,6 @@ IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(OPENVRML_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||
ADD_PLUGIN_DIRECTORY(vrml)
|
||||
ENDIF()
|
||||
|
||||
IF(COLLADA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||
ADD_PLUGIN_DIRECTORY(dae)
|
||||
ENDIF()
|
||||
|
||||
@@ -19,8 +19,19 @@ class ReaderWriterIV : public osgDB::ReaderWriter
|
||||
return osgDB::equalCaseInsensitive(extension, "iv") ? true : false;
|
||||
}
|
||||
|
||||
virtual ReadResult readObject(const std::string& filename, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(filename, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& filename,
|
||||
const osgDB::ReaderWriter::Options*) const;
|
||||
|
||||
virtual ReadResult readObject(std::istream& fin, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fin, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(std::istream& fin,
|
||||
const osgDB::ReaderWriter::Options* = NULL) const;
|
||||
|
||||
|
||||
@@ -62,6 +62,12 @@ class ReaderWritterOpenCASCADE: public osgDB::ReaderWriter
|
||||
/// \brief returns class name
|
||||
virtual const char* className() const { return "STEP/IGES Reader"; }
|
||||
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
virtual osgDB::ReaderWriter::ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*) const;
|
||||
|
||||
virtual osgDB::ReaderWriter::WriteResult writeNode(const osg::Node&, const std::string&, const Options* =NULL) const ;
|
||||
|
||||
@@ -19,7 +19,7 @@ IF(WIN32)
|
||||
mdns_win/dns_sd.h
|
||||
mdns_win/dns-sd.c
|
||||
)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES "${TARGET_EXTERNAL_LIBRARIES};Ws2_32.lib;winmm")
|
||||
SET(TARGET_EXTERNAL_LIBRARIES "${TARGET_EXTERNAL_LIBRARIES};ws2_32.lib;winmm")
|
||||
SET(TARGET_LIBRARIES_VARS ZEROCONF_LIBRARY)
|
||||
ADD_DEFINITIONS(-DNOT_HAVE_GETOPT)
|
||||
ADD_DEFINITIONS(-DNOT_HAVE_SETLINEBUF)
|
||||
|
||||
@@ -78,7 +78,10 @@ class ReaderWriterAC : public osgDB::ReaderWriter
|
||||
}
|
||||
|
||||
virtual const char* className() const { return "AC3D Database Reader"; }
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
virtual ReadResult readNode(const std::string& file,const Options* options) const
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(file);
|
||||
@@ -110,6 +113,10 @@ class ReaderWriterAC : public osgDB::ReaderWriter
|
||||
result.getNode()->setName(fileName);
|
||||
return result;
|
||||
}
|
||||
virtual ReadResult readObject(std::istream& fin, const Options* options) const
|
||||
{
|
||||
return readNode(fin, options);
|
||||
}
|
||||
virtual ReadResult readNode(std::istream& fin, const Options* options) const
|
||||
{
|
||||
std::string header;
|
||||
|
||||
@@ -18,6 +18,11 @@ public:
|
||||
|
||||
virtual bool acceptsExtension(const std::string& extension) const;
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& file,
|
||||
const Options* options) const;
|
||||
};
|
||||
|
||||
@@ -365,12 +365,22 @@ public:
|
||||
virtual const char* className() const
|
||||
{ return "BVH Motion Reader"; }
|
||||
|
||||
virtual ReadResult readObject(std::istream& stream, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(stream, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(std::istream& stream, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
ReadResult rr = BvhMotionBuilder::instance()->buildBVH( stream, options );
|
||||
return rr;
|
||||
}
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& file, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
std::string ext = osgDB::getLowerCaseFileExtension( file );
|
||||
|
||||
@@ -378,6 +378,9 @@ osgDB::ReaderWriter::ReadResult EasyCurl::processResponse(CURLcode res, const st
|
||||
|
||||
ReaderWriterCURL::ReaderWriterCURL()
|
||||
{
|
||||
// initialize curl to ensure it's done single threaded
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
supportsProtocol("http","Read from http port using libcurl.");
|
||||
supportsProtocol("https","Read from https port using libcurl.");
|
||||
supportsProtocol("ftp","Read from ftp port using libcurl.");
|
||||
@@ -395,6 +398,11 @@ ReaderWriterCURL::ReaderWriterCURL()
|
||||
ReaderWriterCURL::~ReaderWriterCURL()
|
||||
{
|
||||
//OSG_NOTICE<<"ReaderWriterCURL::~ReaderWriterCURL()"<<std::endl;
|
||||
|
||||
_threadCurlMap.clear();
|
||||
|
||||
// clean up curl
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
osgDB::ReaderWriter::WriteResult ReaderWriterCURL::writeFile(const osg::Object& obj, osgDB::ReaderWriter* rw, std::ostream& fout, const osgDB::ReaderWriter::Options *options) const
|
||||
|
||||
@@ -144,6 +144,9 @@ ReaderWriterDAE::readNode(const std::string& fname,
|
||||
std::string fileName( osgDB::findDataFile( fname, options ) );
|
||||
if( fileName.empty() ) return ReadResult::FILE_NOT_FOUND;
|
||||
|
||||
pluginOptions.options = options ? osg::clone(options, osg::CopyOp::SHALLOW_COPY) : new Options;
|
||||
pluginOptions.options->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
|
||||
|
||||
OSG_INFO << "ReaderWriterDAE( \"" << fileName << "\" )" << std::endl;
|
||||
|
||||
if (NULL == pDAE)
|
||||
|
||||
@@ -40,7 +40,18 @@ public:
|
||||
|
||||
const char* className() const { return "COLLADA 1.4.x DAE reader/writer"; }
|
||||
|
||||
virtual ReadResult readObject(std::istream& fin, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fin, options);
|
||||
}
|
||||
|
||||
ReadResult readNode(std::istream&, const Options* = NULL) const;
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
ReadResult readNode(const std::string&, const Options* = NULL) const;
|
||||
|
||||
WriteResult writeNode(const osg::Node&, const std::string&, const Options* = NULL) const;
|
||||
|
||||
@@ -280,10 +280,10 @@ void daeReader::processProfileCOMMON(osg::StateSet *ss, domProfile_COMMON *pc )
|
||||
{
|
||||
domProfile_COMMON::domTechnique *teq = pc->getTechnique();
|
||||
|
||||
domProfile_COMMON::domTechnique::domConstant *c = teq->getConstant();
|
||||
domProfile_COMMON::domTechnique::domLambert *l = teq->getLambert();
|
||||
domProfile_COMMON::domTechnique::domPhong *p = teq->getPhong();
|
||||
domProfile_COMMON::domTechnique::domBlinn *b = teq->getBlinn();
|
||||
domProfile_COMMON::domTechnique::domConstant *c = teq ? teq->getConstant() : NULL;
|
||||
domProfile_COMMON::domTechnique::domLambert *l = teq ? teq->getLambert() : NULL;
|
||||
domProfile_COMMON::domTechnique::domPhong *p = teq ? teq->getPhong() : NULL;
|
||||
domProfile_COMMON::domTechnique::domBlinn *b = teq ? teq->getBlinn() : NULL;
|
||||
|
||||
ss->setMode( GL_CULL_FACE, osg::StateAttribute::ON ); // Cull Back faces
|
||||
|
||||
@@ -1136,7 +1136,7 @@ osg::Texture2D* daeReader::processTexture(
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::ref_ptr<osg::Image> img = osgDB::readRefImageFile(parameters.filename);
|
||||
osg::ref_ptr<osg::Image> img = osgDB::readRefImageFile(parameters.filename, _pluginOptions.options.get());
|
||||
|
||||
if (!img.valid())
|
||||
{
|
||||
|
||||
@@ -157,6 +157,7 @@ public:
|
||||
int precisionHint; ///< Precision hint flags, as specified in osgDB::Options::PrecisionHint
|
||||
bool usePredefinedTextureUnits;
|
||||
TessellateMode tessellateMode;
|
||||
osg::ref_ptr<osgDB::ReaderWriter::Options> options;
|
||||
};
|
||||
|
||||
daeReader(DAE *dae_, const Options * pluginOptions);
|
||||
|
||||
@@ -477,155 +477,8 @@ osg::Image* ReadDDSFile(std::istream& _istream, bool flipDDSRead)
|
||||
int packing(1);
|
||||
bool isDXTC(false);
|
||||
|
||||
// Uncompressed formats.
|
||||
if(ddsd.ddpfPixelFormat.dwFlags & DDPF_RGB)
|
||||
{
|
||||
struct RGBFormat
|
||||
{
|
||||
const char* name;
|
||||
UI32 bitCount;
|
||||
UI32 rBitMask;
|
||||
UI32 gBitMask;
|
||||
UI32 bBitMask;
|
||||
UI32 aBitMask;
|
||||
unsigned int internalFormat;
|
||||
unsigned int pixelFormat;
|
||||
unsigned int dataType;
|
||||
};
|
||||
|
||||
const unsigned int UNSUPPORTED = 0;
|
||||
|
||||
static const RGBFormat rgbFormats[] =
|
||||
{
|
||||
{ "R3G3B2" , 8, 0xe0, 0x1c, 0x03, 0x00,
|
||||
GL_RGB , GL_RGB , GL_UNSIGNED_BYTE_3_3_2 },
|
||||
|
||||
{ "R5G6B5" , 16, 0xf800, 0x07e0, 0x001f, 0x0000,
|
||||
GL_RGB , GL_RGB , GL_UNSIGNED_SHORT_5_6_5 },
|
||||
{ "A1R5G5B5" , 16, 0x7c00, 0x03e0, 0x001f, 0x8000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV },
|
||||
{ "X1R5G5B5" , 16, 0x7c00, 0x03e0, 0x001f, 0x0000,
|
||||
GL_RGB , GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV },
|
||||
{ "A4R4G4B4" , 16, 0x0f00, 0x00f0, 0x000f, 0xf000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV },
|
||||
{ "X4R4G4B4" , 16, 0x0f00, 0x00f0, 0x000f, 0x0000,
|
||||
GL_RGB , GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV },
|
||||
{ "A8R3G3B2" , 16, 0x00e0, 0x001c, 0x0003, 0xff00,
|
||||
GL_RGBA, GL_BGRA, UNSUPPORTED },
|
||||
|
||||
{ "R8G8B8", 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000,
|
||||
GL_RGB , GL_BGR , GL_UNSIGNED_BYTE },
|
||||
|
||||
{ "B8G8R8", 24, 0x0000ff, 0x00ff00, 0xff0000, 0x000000,
|
||||
GL_RGB , GL_RGB , GL_UNSIGNED_BYTE },
|
||||
|
||||
{ "A8R8G8B8", 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE },
|
||||
{ "X8R8G8B8", 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000,
|
||||
GL_RGB , GL_BGRA, GL_UNSIGNED_BYTE },
|
||||
{ "A8B8G8R8", 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000,
|
||||
GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE },
|
||||
{ "X8B8G8R8", 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000,
|
||||
GL_RGB , GL_RGBA, GL_UNSIGNED_BYTE },
|
||||
{ "A2R10G10B10", 32, 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV },
|
||||
{ "A2B10G10R10", 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000,
|
||||
GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV },
|
||||
{ "G16R16", 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000,
|
||||
GL_RGB, UNSUPPORTED, GL_UNSIGNED_SHORT },
|
||||
};
|
||||
|
||||
bool found = false;
|
||||
|
||||
for ( unsigned int i = 0; i < sizeof ( rgbFormats ) / sizeof ( RGBFormat ); i++ )
|
||||
{
|
||||
const RGBFormat& f = rgbFormats[ i ];
|
||||
if ( ddsd.ddpfPixelFormat.dwRGBBitCount == f.bitCount &&
|
||||
ddsd.ddpfPixelFormat.dwRBitMask == f.rBitMask &&
|
||||
ddsd.ddpfPixelFormat.dwGBitMask == f.gBitMask &&
|
||||
ddsd.ddpfPixelFormat.dwBBitMask == f.bBitMask &&
|
||||
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask == f.aBitMask )
|
||||
{
|
||||
if ( f.internalFormat != UNSUPPORTED &&
|
||||
f.pixelFormat != UNSUPPORTED &&
|
||||
f.dataType != UNSUPPORTED )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = " << f.name << std::endl;
|
||||
internalFormat = f.internalFormat;
|
||||
pixelFormat = f.pixelFormat;
|
||||
dataType = f.dataType;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : " << f.name
|
||||
<< " format is not supported" << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !found )
|
||||
{
|
||||
OSG_WARN << "ReadDDSFile warning: unhandled RGB pixel format in dds file, image not loaded" << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwRGBBitCount = "
|
||||
<< ddsd.ddpfPixelFormat.dwRGBBitCount << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwRBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwRBitMask << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwGBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwGBitMask << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwBBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwBBitMask << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwRGBAlphaBitMask << std::dec << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_LUMINANCE)
|
||||
{
|
||||
internalFormat = usingAlpha ? GL_LUMINANCE_ALPHA : GL_LUMINANCE;
|
||||
pixelFormat = usingAlpha ? GL_LUMINANCE_ALPHA : GL_LUMINANCE;
|
||||
if ( usingAlpha && ddsd.ddpfPixelFormat.dwLuminanceBitDepth == 8 )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L4A4" << std::endl;
|
||||
pixelFormat = GL_LUMINANCE4_ALPHA4; // invalid enumerant?
|
||||
}
|
||||
else if ( usingAlpha && ddsd.ddpfPixelFormat.dwLuminanceBitDepth == 32 )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L16A16" << std::endl;
|
||||
dataType = GL_UNSIGNED_SHORT;
|
||||
}
|
||||
else if ( !usingAlpha && ddsd.ddpfPixelFormat.dwLuminanceBitDepth == 16 )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L16" << std::endl;
|
||||
dataType = GL_UNSIGNED_SHORT;
|
||||
}
|
||||
else if ( usingAlpha )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L8A8" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L8" << std::endl;
|
||||
}
|
||||
// else if ( ddsd.ddpfPixelFormat.dwLuminanceBitDepth == (usingAlpha ? 64 : 32) )
|
||||
// {
|
||||
// dataType = GL_UNSIGNED_INT;
|
||||
// }
|
||||
}
|
||||
else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_ALPHA)
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = ALPHA" << std::endl;
|
||||
internalFormat = GL_ALPHA;
|
||||
pixelFormat = GL_ALPHA;
|
||||
}
|
||||
// Compressed formats
|
||||
else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_FOURCC)
|
||||
if(ddsd.ddpfPixelFormat.dwFlags & DDPF_FOURCC)
|
||||
{
|
||||
switch(ddsd.ddpfPixelFormat.dwFourCC)
|
||||
{
|
||||
@@ -676,7 +529,7 @@ osg::Image* ReadDDSFile(std::istream& _istream, bool flipDDSRead)
|
||||
break;
|
||||
case 0x00000071: // A16B16G16R16F
|
||||
OSG_INFO << "ReadDDSFile info : format = A16B16G16R16F" << std::endl;
|
||||
internalFormat = GL_RGBA; // why no transparency?
|
||||
internalFormat = GL_RGBA16F_ARB; // why no transparency?
|
||||
pixelFormat = GL_RGBA;
|
||||
dataType = GL_HALF_FLOAT;
|
||||
break;
|
||||
@@ -704,19 +557,19 @@ osg::Image* ReadDDSFile(std::istream& _istream, bool flipDDSRead)
|
||||
break;
|
||||
case 0x00000072: // R32F
|
||||
OSG_INFO << "ReadDDSFile info : format = R32F" << std::endl;
|
||||
internalFormat = GL_RGB;
|
||||
internalFormat = GL_R32F;
|
||||
pixelFormat = GL_RED;
|
||||
dataType = GL_FLOAT;
|
||||
break;
|
||||
case 0x0000006F: // R16F
|
||||
OSG_INFO << "ReadDDSFile info : format = R16F" << std::endl;
|
||||
internalFormat = GL_RGB;
|
||||
internalFormat = GL_R16F;
|
||||
pixelFormat = GL_RED;
|
||||
dataType = GL_HALF_FLOAT;
|
||||
break;
|
||||
case 0x00000074: // A32B32G32R32F
|
||||
OSG_INFO << "ReadDDSFile info : format = A32B32G32R32F" << std::endl;
|
||||
internalFormat = GL_RGBA;
|
||||
internalFormat = GL_RGBA32F_ARB;
|
||||
pixelFormat = GL_RGBA;
|
||||
dataType = GL_FLOAT;
|
||||
break;
|
||||
@@ -944,6 +797,153 @@ osg::Image* ReadDDSFile(std::istream& _istream, bool flipDDSRead)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
// Uncompressed formats.
|
||||
else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_RGB)
|
||||
{
|
||||
struct RGBFormat
|
||||
{
|
||||
const char* name;
|
||||
UI32 bitCount;
|
||||
UI32 rBitMask;
|
||||
UI32 gBitMask;
|
||||
UI32 bBitMask;
|
||||
UI32 aBitMask;
|
||||
unsigned int internalFormat;
|
||||
unsigned int pixelFormat;
|
||||
unsigned int dataType;
|
||||
};
|
||||
|
||||
const unsigned int UNSUPPORTED = 0;
|
||||
|
||||
static const RGBFormat rgbFormats[] =
|
||||
{
|
||||
{ "R3G3B2" , 8, 0xe0, 0x1c, 0x03, 0x00,
|
||||
GL_RGB , GL_RGB , GL_UNSIGNED_BYTE_3_3_2 },
|
||||
|
||||
{ "R5G6B5" , 16, 0xf800, 0x07e0, 0x001f, 0x0000,
|
||||
GL_RGB , GL_RGB , GL_UNSIGNED_SHORT_5_6_5 },
|
||||
{ "A1R5G5B5" , 16, 0x7c00, 0x03e0, 0x001f, 0x8000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV },
|
||||
{ "X1R5G5B5" , 16, 0x7c00, 0x03e0, 0x001f, 0x0000,
|
||||
GL_RGB , GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV },
|
||||
{ "A4R4G4B4" , 16, 0x0f00, 0x00f0, 0x000f, 0xf000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV },
|
||||
{ "X4R4G4B4" , 16, 0x0f00, 0x00f0, 0x000f, 0x0000,
|
||||
GL_RGB , GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV },
|
||||
{ "A8R3G3B2" , 16, 0x00e0, 0x001c, 0x0003, 0xff00,
|
||||
GL_RGBA, GL_BGRA, UNSUPPORTED },
|
||||
|
||||
{ "R8G8B8", 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000,
|
||||
GL_RGB , GL_BGR , GL_UNSIGNED_BYTE },
|
||||
|
||||
{ "B8G8R8", 24, 0x0000ff, 0x00ff00, 0xff0000, 0x000000,
|
||||
GL_RGB , GL_RGB , GL_UNSIGNED_BYTE },
|
||||
|
||||
{ "A8R8G8B8", 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE },
|
||||
{ "X8R8G8B8", 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000,
|
||||
GL_RGB , GL_BGRA, GL_UNSIGNED_BYTE },
|
||||
{ "A8B8G8R8", 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000,
|
||||
GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE },
|
||||
{ "X8B8G8R8", 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000,
|
||||
GL_RGB , GL_RGBA, GL_UNSIGNED_BYTE },
|
||||
{ "A2R10G10B10", 32, 0x000003ff, 0x000ffc00, 0x3ff00000, 0xc0000000,
|
||||
GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV },
|
||||
{ "A2B10G10R10", 32, 0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000,
|
||||
GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV },
|
||||
{ "G16R16", 32, 0x0000ffff, 0xffff0000, 0x00000000, 0x00000000,
|
||||
GL_RGB, UNSUPPORTED, GL_UNSIGNED_SHORT },
|
||||
};
|
||||
|
||||
bool found = false;
|
||||
|
||||
for ( unsigned int i = 0; i < sizeof ( rgbFormats ) / sizeof ( RGBFormat ); i++ )
|
||||
{
|
||||
const RGBFormat& f = rgbFormats[ i ];
|
||||
if ( ddsd.ddpfPixelFormat.dwRGBBitCount == f.bitCount &&
|
||||
ddsd.ddpfPixelFormat.dwRBitMask == f.rBitMask &&
|
||||
ddsd.ddpfPixelFormat.dwGBitMask == f.gBitMask &&
|
||||
ddsd.ddpfPixelFormat.dwBBitMask == f.bBitMask &&
|
||||
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask == f.aBitMask )
|
||||
{
|
||||
if ( f.internalFormat != UNSUPPORTED &&
|
||||
f.pixelFormat != UNSUPPORTED &&
|
||||
f.dataType != UNSUPPORTED )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = " << f.name << std::endl;
|
||||
internalFormat = f.internalFormat;
|
||||
pixelFormat = f.pixelFormat;
|
||||
dataType = f.dataType;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : " << f.name
|
||||
<< " format is not supported" << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !found )
|
||||
{
|
||||
OSG_WARN << "ReadDDSFile warning: unhandled RGB pixel format in dds file, image not loaded" << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwRGBBitCount = "
|
||||
<< ddsd.ddpfPixelFormat.dwRGBBitCount << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwRBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwRBitMask << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwGBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwGBitMask << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwBBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwBBitMask << std::endl;
|
||||
OSG_INFO << "ReadDDSFile info : ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0x"
|
||||
<< std::hex << std::setw(8) << std::setfill('0')
|
||||
<< ddsd.ddpfPixelFormat.dwRGBAlphaBitMask << std::dec << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_LUMINANCE)
|
||||
{
|
||||
internalFormat = usingAlpha ? GL_LUMINANCE_ALPHA : GL_LUMINANCE;
|
||||
pixelFormat = usingAlpha ? GL_LUMINANCE_ALPHA : GL_LUMINANCE;
|
||||
if ( usingAlpha && ddsd.ddpfPixelFormat.dwLuminanceBitDepth == 8 )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L4A4" << std::endl;
|
||||
pixelFormat = GL_LUMINANCE4_ALPHA4; // invalid enumerant?
|
||||
}
|
||||
else if ( usingAlpha && ddsd.ddpfPixelFormat.dwLuminanceBitDepth == 32 )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L16A16" << std::endl;
|
||||
dataType = GL_UNSIGNED_SHORT;
|
||||
}
|
||||
else if ( !usingAlpha && ddsd.ddpfPixelFormat.dwLuminanceBitDepth == 16 )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L16" << std::endl;
|
||||
dataType = GL_UNSIGNED_SHORT;
|
||||
}
|
||||
else if ( usingAlpha )
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L8A8" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = L8" << std::endl;
|
||||
}
|
||||
// else if ( ddsd.ddpfPixelFormat.dwLuminanceBitDepth == (usingAlpha ? 64 : 32) )
|
||||
// {
|
||||
// dataType = GL_UNSIGNED_INT;
|
||||
// }
|
||||
}
|
||||
else if(ddsd.ddpfPixelFormat.dwFlags & DDPF_ALPHA)
|
||||
{
|
||||
OSG_INFO << "ReadDDSFile info : format = ALPHA" << std::endl;
|
||||
internalFormat = GL_ALPHA;
|
||||
pixelFormat = GL_ALPHA;
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN << "ReadDDSFile warning: unhandled pixel format (ddsd.ddpfPixelFormat.dwFlags"
|
||||
|
||||
@@ -43,6 +43,11 @@ public:
|
||||
{
|
||||
return "ReaderWriterDirectShow";
|
||||
}
|
||||
|
||||
virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readImage(file, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readImage(const std::string & filename, const osgDB::ReaderWriter::Options * options) const
|
||||
{
|
||||
|
||||
@@ -40,6 +40,11 @@ public:
|
||||
|
||||
virtual const char* className() const { return "Autodesk DXF Reader/Writer"; }
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
return readNode(fileName, options);
|
||||
}
|
||||
|
||||
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*) const;
|
||||
|
||||
|
||||
|
||||
@@ -20,11 +20,17 @@ SET(TARGET_H
|
||||
WriterNodeVisitor.h
|
||||
)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "-w")
|
||||
|
||||
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
|
||||
REMOVE_CXX_FLAG(-pedantic)
|
||||
REMOVE_CXX_FLAG(-Wall)
|
||||
REMOVE_CXX_FLAG(-Wunused)
|
||||
REMOVE_CXX_FLAG(-Wextra)
|
||||
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user