Re: [osg-users] retrieve texture id

2011-10-04 Thread J.P. Delport

Hi,

an alternative to doing this manually would be to look at 
osgCompute/osgCuda. Even if you don't use osgCuda you can learn from 
there how to do what you want.


cheers
jp

On 05/10/2011 01:28, Conan Doyle wrote:

Hi,

[dumbquestion]

I am integrating some cuda into my osg app and one call requires the texture 
name/id.  How do I get that from my texture object?  I look through the source 
code and only found and id method in TextureObject, but my attempts to 
retrieive this bit of data eludes me.

[/dumbquestion]

Thank you!

Cheers,
Conan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43179#43179





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] PagedLODs under an RTT camera - how to use the proper viewpoint?

2011-10-04 Thread Chris 'Xenon' Hanson
On 10/4/2011 3:10 PM, Glenn Waldron wrote:
> Hi friends,
> I have a graph under an RTT camera. That graph contains PagedLODs. Of course, 
> I want the
> cull traversal to load the PagedLODs based on my "main" scene camera, and NOT 
> based on the
> RTT camera's location.
> I've tried a couple of things:
> 1) Calling CullVisitor::pushReferenceViewPoint on the RTT subgraph ... to no 
> effect
> 2) Creating a new RenderStage and traversing the RTT subgraph a second time 
> with it; that
> works in terms of properly activating the PagedLODs, but not for rendering - 
> the still
> switch in/out relative to the RTT camera.
> I'd appreciate some pointers on this one. Thanks.

  Wouldn't shadowmap cameras face the same issue hand have already solved this? 
Maybe the
technique can be inferred from there.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
"There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] retrieve texture id

2011-10-04 Thread Jean-Sébastien Guay

Hello Conan,


I create my gc manually then create viewer/window etc... so my code looks like 
this:

unsigned int contextID = gc.get()->getState()->getContextID()
unsigned int textureID = texture[0]->getTextureObject(contextID)->id();

Upon executing the "textureID = " I get a seg fault, and upon further checking,  
texture[0]->getTextureObject(contextID) = 0.


(you don't need gc.get() above, ref_ptr has an overloaded operator-> 
that takes care of that for you so you can just do gc->... )


As with any pointer access in C++ programming, you have to be sure that 
when you do something, you're not dereferencing a null pointer.


What you're doing is perfectly fine, as long as you do it after the 
first frame has rendered. The getTextureObject(...) call will return 
NULL before that, because OSG uses lazy initialization to only allocate 
objects once they're needed. OpenGL objects and the OSG objects that 
hold them are examples of this.


So the safest way is to just let OSG render one frame, and then you can 
get your texture object (for example, check if the result of 
getTextureObject() is NULL, if not then get your texture ID, and then do 
your thing).


If you really want to, you can force OSG to allocate all objects in your 
scene at startup by doing this:


viewer->realize();
viewer->stopThreading();

gc->makeCurrent();

osgUtil::GLObjectsVisitor glov;
glov.setState(gc->getState());
viewer->getCamera()->accept(glov);

gc->releaseContext();

viewer->startThreading();

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] retrieve texture id

2011-10-04 Thread Conan Doyle
This is actually what I tried.  The issue texture->getTextureObject(contextID) 
returns 0, which I assume means a null pointer?

I create my gc manually then create viewer/window etc... so my code looks like 
this:

unsigned int contextID = gc.get()->getState()->getContextID()
unsigned int textureID = texture[0]->getTextureObject(contextID)->id();

Upon executing the "textureID = " I get a seg fault, and upon further checking, 
 texture[0]->getTextureObject(contextID) = 0.

CD



Skylark wrote:
> Hi Conan,
> 
> (I have the impression your name is a pseudonym, I wonder why... ;-)
> 
> 
> > [dumbquestion]
> > 
> > I am integrating some cuda into my osg app and one call requires the 
> > texture name/id.  How do I get that from my texture object?  I look through 
> > the source code and only found and id method in TextureObject, but my 
> > attempts to retrieive this bit of data eludes me.
> > 
> > [/dumbquestion]
> > 
> 
> Not a dumb question at all, part of learning how to use OSG is learning 
> how the things fit together and what to do to get to the information you 
> need...
> 
> From an osg::Texture* (Texture2D, etc.) you have access to the 
> interface of osg::Texture (which Texture2D et al are subclasses of). But 
> first, to get to your OpenGL texture ID for a given Texture2D, you need 
> the context ID in which you want to get that information, which you can 
> get for example from the GraphicsContext like so:
> 
> unsigned int contextID = gc->getState()->getContextID()
> 
> Then you can do:
> 
> GLuint textureID = texture->getTextureObject(contextID)->id();
> 
> to get the ID of the texture object in that context.
> 
> Hope this helps,
> 
> J-S
> -- 
> __
> Jean-Sebastien Guay
> http://www.cm-labs.com/
> http://whitestar02.dyndns-web.com/
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43181#43181





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] retrieve texture id

2011-10-04 Thread Jean-Sébastien Guay

Hi Conan,

(I have the impression your name is a pseudonym, I wonder why... ;-)


[dumbquestion]

I am integrating some cuda into my osg app and one call requires the texture 
name/id.  How do I get that from my texture object?  I look through the source 
code and only found and id method in TextureObject, but my attempts to 
retrieive this bit of data eludes me.

[/dumbquestion]


Not a dumb question at all, part of learning how to use OSG is learning 
how the things fit together and what to do to get to the information you 
need...


From an osg::Texture* (Texture2D, etc.) you have access to the 
interface of osg::Texture (which Texture2D et al are subclasses of). But 
first, to get to your OpenGL texture ID for a given Texture2D, you need 
the context ID in which you want to get that information, which you can 
get for example from the GraphicsContext like so:


unsigned int contextID = gc->getState()->getContextID()

Then you can do:

GLuint textureID = texture->getTextureObject(contextID)->id();

to get the ID of the texture object in that context.

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] retrieve texture id

2011-10-04 Thread Conan Doyle
Hi,

[dumbquestion]

I am integrating some cuda into my osg app and one call requires the texture 
name/id.  How do I get that from my texture object?  I look through the source 
code and only found and id method in TextureObject, but my attempts to 
retrieive this bit of data eludes me.

[/dumbquestion]

Thank you!

Cheers,
Conan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43179#43179





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] PagedLODs under an RTT camera - how to use the proper viewpoint?

2011-10-04 Thread Glenn Waldron
Hi friends,

I have a graph under an RTT camera. That graph contains PagedLODs. Of
course, I want the cull traversal to load the PagedLODs based on my "main"
scene camera, and NOT based on the RTT camera's location.

I've tried a couple of things:

1) Calling CullVisitor::pushReferenceViewPoint on the RTT subgraph ... to no
effect

2) Creating a new RenderStage and traversing the RTT subgraph a second time
with it; that works in terms of properly activating the PagedLODs, but not
for rendering - the still switch in/out relative to the RTT camera.

I'd appreciate some pointers on this one. Thanks.


Glenn Waldron / Pelican Mapping / @glennwaldron
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CMake INSTALL target and vc10

2011-10-04 Thread Jean-Sébastien Guay

Hi Mattias,


The osgPPU.dll it's trying to copy is actually in

C:\Dev\OSG_Nodekits\osgPPU\build_vc10sp1_osg283\lib\Release


Actually I was wrong, that was an old one. The one it's building now is 
correctly in


C:\Dev\OSG_Nodekits\osgPPU\build_vc10sp1_osg283\bin

So it seems that the problem is the install, which tries to find it in

C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/bin/../../bin

(it could just remove the ../../bin and find it there)

How can I control where the install target tries to find stuff? Here is 
the ModuleInstall.cmake file that comes with osgPPU source.


Thanks in advance,

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
# INSTALL and SOURCE_GROUP commands for osgPPU

# Required Vars:
# ${LIB_NAME}
# ${LIB_PUBLIC_HEADERS}

# --
# Setup destination directories
# --
SET(INSTALL_INCDIR include)
SET(INSTALL_BINDIR bin)
SET(INSTALL_SRCDIR src)
IF(WIN32)
SET(INSTALL_LIBDIR bin)
SET(INSTALL_ARCHIVEDIR lib)
ELSE(WIN32)
SET(INSTALL_LIBDIR lib)
SET(INSTALL_ARCHIVEDIR lib)
ENDIF(WIN32)

IF(MSVC)
HANDLE_MSVC_DLL()
ENDIF(MSVC)

INSTALL(
TARGETS ${LIB_NAME}
RUNTIME DESTINATION ${INSTALL_BINDIR}
LIBRARY DESTINATION ${INSTALL_LIBDIR}
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR}
)


# --
# Setup header file group for Visual Studio
# --
SET(HEADERS_GROUP "Header Files")
SOURCE_GROUP(
${HEADERS_GROUP}
FILES ${LIB_PUBLIC_HEADERS}
)

# --
# Setup source file group for Visual Studio
# --
SET(SRC_GROUP "Source Files")
SOURCE_GROUP(
${SRC_GROUP}
FILES ${LIB_SRC_FILES}
)


# --
# Install routines for differnet components
# FIXME: Do not run for OS X framework
# --
INSTALL(
FILES${LIB_PUBLIC_HEADERS}
DESTINATION  ${INSTALL_INCDIR}/${LIB_NAME}
COMPONENT${PACKAGE_HEADERS} 
)

INSTALL(
FILES${LIB_SRC_FILES}
DESTINATION  ${INSTALL_SRCDIR}/${LIB_NAME}
COMPONENT${PACKAGE_SRC}
)

#---
# Include the build system parts to the source package
#---
INSTALL (
FILES
${PROJECT_SOURCE_DIR}/CMakeLists.txt
${PROJECT_SOURCE_DIR}/ChangeLog
${PROJECT_SOURCE_DIR}/CONTRIBUTORS.txt
${PROJECT_SOURCE_DIR}/LICENSE.txt
DESTINATION ./
COMPONENT  ${PACKAGE_SRC}
)

INSTALL (
FILES
${PROJECT_SOURCE_DIR}/src/CMakeLists.txt
DESTINATION src
COMPONENT  ${PACKAGE_SRC}
)

INSTALL (
FILES
${PROJECT_SOURCE_DIR}/src/osgPlugins/CMakeLists.txt
DESTINATION src/osgPlugins
COMPONENT  ${PACKAGE_SRC}
)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CMake INSTALL target and vc10

2011-10-04 Thread Jean-Sébastien Guay

Hi Mattias,


I think the easy solution is to set:
CMAKE_ARCHIVE_OUTPUT_DIRECTORY, CMAKE_RUNTIME_OUTPUT_DIRECTORY and
CMAKE_LIBRARY_OUTPUT_DIRECTORY properly.


Where do I have to set these?

I tried inserting the code you gave either in the ModuleInstall.cmake 
module, or in the top-level CMakeLists.txt (after the PROJECT(...) line) 
and it didn't seem to change anything. I think the problem is that even 
though I'm setting the CMAKE_*_OUTPUT_DIRECTORY variables, the DLLs are 
still falling in a "Release" or "Debug" directory under lib... But I 
don't know why. I even tried removing my build directory (including the 
CMakeCache.txt) and rebuilding, but that didn't help. Can you help me 
figure out what is going wrong?


Here is what I added:

set(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
set(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
if(WIN32)
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
else()
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
endif()

# For each configuration (Debug, Release, MinSizeRel... and/or anything 
the user chooses)

foreach(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
if(WIN32)
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
else()
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
endif()
endforeach()

MESSAGE("PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}")
MESSAGE("OUTPUT_LIBDIR=${OUTPUT_LIBDIR}")
MESSAGE("CMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} ...")
MESSAGE("CMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ...")
MESSAGE("CMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ...")

And I don't see anywhere else where the CMAKE_*_OUTPUT_DIRECTORY 
variables are modified. The output I get from my MESSAGE lines is:


1>  PROJECT_BINARY_DIR=C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283
1>  OUTPUT_LIBDIR=C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/lib
1> 
CMAKE_ARCHIVE_OUTPUT_DIRECTORY=C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/lib 
...
1> 
CMAKE_RUNTIME_OUTPUT_DIRECTORY=C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/bin 
...
1> 
CMAKE_LIBRARY_OUTPUT_DIRECTORY=C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/bin 
...


and the error I get when building the INSTALL target is:

3>  CMake Error at src/osgPPU/cmake_install.cmake:50 (FILE):
3>file INSTALL cannot find
3> 
"C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/bin/../../bin/osgPPU.dll".

3>  Call Stack (most recent call first):
3>src/cmake_install.cmake:33 (INCLUDE)
3>cmake_install.cmake:32 (INCLUDE)

The osgPPU.dll it's trying to copy is actually in

C:\Dev\OSG_Nodekits\osgPPU\build_vc10sp1_osg283\lib\Release

The top-level CMakeLists.txt is attached. I am using CMake 2.8.4.

Thanks in advance,

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)

# Setup compatibility modes
IF(COMMAND cmake_policy)
if(POLICY CMP0011)
cmake_policy(SET CMP0011 OLD) # or NEW
endif(POLICY CMP0011)

cmake_policy(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy)



# Set default values

PROJECT(osgPPU)
SET(CMAKE_MODULE_PATH 
"${osgPPU_SOURCE_DIR}/CMakeModules;${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
SET(SOURCE_DIR ${osgPPU_SOURCE_DIR})
SET(OSG_DIR "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Path where to find the osg 
installation")
SET(CUDA_DIR "${CMAKE_INSTALL_PREFIX}/cuda" CACHE STRING "Path where to find 
the cuda installation")

set(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
set(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
if(WIN32)
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
else()
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
endif()

# For each configuration (Debug, Release, MinSizeRel... and/or anything the 
user chooses)
foreach(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
if(WIN32)
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
else()
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
endif()
endf

Re: [osg-users] Incremental renderingTraversal between swapBuffers on iOS

2011-10-04 Thread Christian Noon
Wow I feel like today is my birthday! Thanks for the pointers Robert. I think 
options 1 and 2 both sound like they have the potential to do exactly what I 
need. OSG for the win! I'll try them out and post back with my results.

Thanks again,
--

Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43175#43175





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgjs - RenderBin and Transparency

2011-10-04 Thread Cedric Pinson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I commited new code to upgrade RenderBin code. You should be able to
manage bin like in osg, but I implemented the minimum to have
flexibility with render bin. There is no OVERRIDE_RENDERBIN_DETAILS.
I added the transparent RenderBin that will sort your objects from
back to front.
It's possible to add your own RenderBin like this:

osg.RenderBin.BinPrototypes['UberRenderBin'] = new UberBinCreator();

then use this in your stateset:
var quad = osg.createTextureBoxGeometry(0,0,0, 2,2,2);
quad.getOrCreateStateSet().setRenderBinDetails(15, 'UberRenderBin');


There is current limitation with this. osg allow you to create
renderStage from the prototype but no osgjs.


Basics usages to manage transparency:

var root = new osg.Node();
var quad = osg.createTextureBoxGeometry(0,0,0, 2,2,2);

var node0 = new osg.MatrixTransform();
node0.setMatrix(osg.Matrix.makeTranslate(0,0,1,[]));
node0.addChild(quad);
node0.getOrCreateStateSet().setRenderingHint('TRANSPARENT_BIN');

var node1 = new osg.MatrixTransform();
node1.setMatrix(osg.Matrix.makeTranslate(0,0,10,[]));
node1.addChild(quad);

child of node0 will be sorted back to front and child of node1 will
not be sorted.


If you experience performance issue please report it.



Cedric - http://osgjs.org


- -- 
Cedric Pinson
Provide OpenGL, WebGL and OpenSceneGraph services
+33 659 598 614 - cedric.pin...@plopbyte.com
http://plopbyte.com - http://osgjs.org - http://showwebgl.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6LAKoACgkQs6ZHzVQN0Ih2iQCePegdHpPui0cvq09Wa8MqcCa8
WpoAoJfS3DYhw9hqYkeoCDGwx2yL/9z5
=x+Hp
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Shadow debugging

2011-10-04 Thread Wojciech Lewandowski

Hi,

You will probably need to dive into osgShadow code with debugger. I would 
recommend using osgShadow::ShadowMap for this purpose. Its probably simplest 
from depth shadow mapping  techniques. I would put the breakpoint at start 
of void ShadowMap::cull(osgUtil::CullVisitor& cv) method and would step it 
line by line to check if all steps are performed correctly. This methods 
first culls main camera scene where shadows will be applied. Later finds the 
light source used to cast shadows, then computes shadow camera projection 
and view matrices based on light source and culls the scene for shadow 
camera,  finally sets the texgen for applying shadows for main camera scene. 
This order of operations may sound strange but you have to remember that 
scenes per cameras can be culled in any order. Its Cameras Render Order that 
decides that shadow map will be rendered before main scene in Render 
traversals. So shadow map will be ready for use when main camera scene will 
be rendered.


Imho most probable problem here is your code does not find the light source 
and then succesive operations are bound to fail because shadow camera 
projection is incorrectly computed and scene for shadow map culled out.  If 
the light is found and reasonable view and projection matrices for shadow 
camera are set then it probably means that shadow camera cull/render does 
not render the scene for some unknown reason ( I would check Casts Shadow 
masks on this occasion).


And I have no more ideas. I hope this problem is one of the above, if not 
you are on your own to dig further.  But thats really good opprtunity to 
learn how OSG works ;-)


Cheers,
Wojtek







-Oryginalna wiadomość- 
From: Jaap van den Bosch

Sent: Monday, October 03, 2011 11:31 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] OSG Shadow debugging

I already was suspicious of the empty right square. Looks like the shaders 
are not functioning somehow. Here are some more results:


ShadowMap: Overall dimming, empty DebugHUD camera. See picture below
PSSM: Application crash...
ShadowVolume: Shadow pointing down: Blank screen. Other light direction: 
overblown colors. See picture below
SoftShadowMap: Light from above: no change. Light from an angle: Noise 
pattern as shadow. See picture below
Shadowtexture: blank screen. Primitives amount: 0 (somehow they have 
disappeared).


Wojciech, do you suspect a culprit responsible for these problems?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43159#43159




Attachments:
http://forum.openscenegraph.org//files/softshadowmap_770.jpg
http://forum.openscenegraph.org//files/shadowvolume_532.jpg
http://forum.openscenegraph.org//files/shadowmap_183.jpg


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CMake INSTALL target and vc10

2011-10-04 Thread Mattias Helsing
Hi J-S,

I think the easy solution is to set:
CMAKE_ARCHIVE_OUTPUT_DIRECTORY, CMAKE_RUNTIME_OUTPUT_DIRECTORY and
CMAKE_LIBRARY_OUTPUT_DIRECTORY properly. That is all I do on my
personal projects and it it what is done in the OSG toplevel
CMakeLists.txt. However this requires cmake-2.6.0. cmake-2.8.1
expanded this to have a set per configuration, so you would have
CMAKE__OUTPUT_DIRECTORY_

My life is easy because I don't have the userbase of a large community
as OpenSceneGraph's, so I can just require cmake > 2.8.0 from myself
and my internal customers :). The osg build system is getting pretty
clogged with fixes and macros to find out cmake version, emulate newer
cmake functions on older versions of cmake and choosing different code
paths given to found version. It is frankly quite hard to follow.
Have a look at osg's CMakeLists.txt at line 635 where the above
mentioned variables are set (for cmake >= 2.6.0). Also - in
CMakeModules/OsgMacroUtils.cmake there's a macro
SET_OUTPUT_DIR_PROPERTY(...) that is used to "fix" the output paths
for plugins primarily (since they go under bin/osgPlugins-xyz).

Here's my macro for setting this up. Works with msvc8, msvc10, rhel5,
ubuntu all with cmake version > 2.8.1:

macro(sbd_setup_output_dirs)
set(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
set(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
if(WIN32)
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
else()
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
endif()

# For each configuration (Debug, Release, MinSizeRel... and/or
anything the user chooses)
foreach(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
if(WIN32)
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
else()
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
endif()
endforeach()

endmacro()


cheers
Mattias

On Mon, Oct 3, 2011 at 8:48 PM, Jean-Sébastien Guay
 wrote:
> Hi all,
>
> I vaguely remember there being a discussion about this when vc10 came out,
> but I don't remember the conclusion or what fixed it for OSG, so...
>
> I'm trying to compile osgPPU for vc10, and I'm getting this error when
> building the INSTALL target:
>
> 2>  -- Installing:
> C:/Dev/OSG_Nodekits/osgPPU/install_vc10sp1_osg283/lib/osgPPUd.lib
> 2>  CMake Error at src/osgPPU/cmake_install.cmake:47 (FILE):
> 2>    file INSTALL cannot find
> 2>
> "C:/Dev/OSG_Nodekits/osgPPU/build_vc10sp1_osg283/lib/Debug/../../bin/osgPPUd.dll".
>
> The problem is that osgPPUd.dll is not in
>  lib/Debug/../../bin/osgPPUd.dll
> but in
>  lib/Debug/../../bin/Debug/osgPPUd.dll
>
> As I said, I'm pretty sure I saw people reporting this for OSG on vc10 when
> it came out, but I wasn't using vc10 back then so I don't remember what the
> solution was... Can anyone refresh my memory please? :-)
>
> Thanks in advance,
>
> J-S
> --
> __
> Jean-Sébastien Guay    jean-sebastien.g...@cm-labs.com
>                               http://www.cm-labs.com/
>                    http://whitestar02.dyndns-web.com/
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Incremental renderingTraversal between swapBuffers on iOS

2011-10-04 Thread Robert Osfield
Hi Christian,

You have picked a rather challenging problem to tackle :-)

If I'm reading it right you want to interleave checking and handling
of events in with the rendering of a frame.  This broadly could be
done by either :

 1) placing event checking into the draw traversal

 2) disabling swap buffers so that it doesn't occur on every "frame"
and rendering different part the scene
 in each "frame", then finally enabling swap buffers on the final "frame".

 3) run the view in a back ground thread and handle the events and
interrupt the draw traversal use osg::State::setAbortRenderingPtr() to
single from the main thread that the draw traversal should finish
prematurely.


Solution 1) could be done for a single threaded application, and
perhaps one could use a Drawable draw callback that does a rendering
of Drawable and then checks/handles the events.

Solution 2) would require the scene graph to be segmented and placed
underneath a custom sequence node that renders different subgraphs on
different frames.  The swap buffers operation would also be customized
so that it could be switched off, and have the clear of the frame
buffer also be toggled on/off so that subsequent frames wouldn't clear
the colour/depth buffer or swap buffers.

Solution 3) seems like it might be something you've already tried.

Robert.


On Tue, Oct 4, 2011 at 3:34 AM, Christian Noon  wrote:
> Hello,
>
> First off, I have to give out props to everyone for OSG 3amazing! I've 
> been doing OSG dev on a Mac for roughly 4 years now and the new release has 
> made my life s much easier!
>
> Anyways, onto business. I'm currently working on a custom volume renderer on 
> iOS that uses OSG underneath for all rendering purposes. Unfortunately, I 
> have hit a major roadblock and would love if anyone could provide some 
> insight or a possible way forward.
>
> My issue is that when rendering a high resolution volume (512x512x256), 
> rendering can take over an entire second on an iPad 2 using texture slicing, 
> and raycasting would be even slower. Obviously this is anything but real-time 
> rendering. In order to improve performance, I am rendering a much smaller 
> viewport in a PRE_RENDER camera when touch events occur. Then I grab the fbo, 
> attach it to a 2D texture, and render it with a quad in a POST_RENDER camera 
> scaled up to the current viewport...works great. However, after the 
> touch_release event, I switch back to rendering the high resolution viewport 
> in the main camera. This gives a sort of fake impression that the volume 
> doesn't really look as crappy as it really does when the high resolution one 
> pops right back in. In addition, a user should not have to wait until the 
> high resolution render completes before being able to interact with the 
> volume again. Unfortunately, this is currently the situation I'm stuck in.
>
> My problem is that I cannot stop the high resolution render once it has begun 
> meaning I need to be able to stop it in the middle of rendering. 
> Unfortunately, this is currently not possible because once the high 
> resolution render begins, it pushes enough GPU calculations that the iOS run 
> loop quits emitting touch events until the render completes. Probably some 
> very low level optimization to try to keep framerates as high as possible. 
> Once the frame takes so long to complete, the events are simply delayed. 
> Since this delay occurs, I cannot even get touch events to try to notify 
> osgViewer to stop traversal through either the osgViewer::Viewer::setDone 
> flag or the really old osg::State::setAbortRenderingPtr(bool*) approach.
>
> After several days of digging, I've finally been able to reproduce this 
> problem in a pure OpenGLES app as well. Whether I render on the main thread 
> runloop, worker thread runloop, or even a worker thread runloop wrapping GCD 
> queue calls, they all suffer from the problem. UI touch events are delayed 
> until rendering completes. Rendering basically works as shown in the 
> following psuedo code:
>
>
> Code:
>
>
> asyncThreadRunLoop()
> {
>    while (isRunning)
>    {
>        iOS->processTouchEvents(); // This call doesn't really exist, called 
> by the iOS run loop per thread
>        viewer->frame();
>    }
> }
>
> viewer::frame()
> {
>    for (all nodes)
>        node->draw()
>
>    swapBuffers();
> }
>
>
>
>
>
> However, in my OpenGLES application, I was able to build a workaround. 
> Instead of rendering all the quads at once and swapping buffers at the end 
> every time I render, I am rendering it in chunks before swapping buffers.
>
>
> Code:
>
>
> asyncThreadRunLoop()
> {
>    static int renderCount = 0;
>    while (isRunning)
>    {
>        iOS->processTouchEvents(); // This call doesn't really exist, called 
> by the iOS run loop per thread
>        viewer->frame(renderCount);
>
>        if (renderCount == 10)
>            renderCount = 0;
>        else
>            ++renderCount;
>    }
> }
>
> viewer::frame(int in

Re: [osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-10-04 Thread Art Tevs
Hi Alexander,

thank you for the patch. I will check it out in the next days and wil patch 
osgPPU sources accordingly.

Cheers,
Art

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43169#43169





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org