Hi Johan,
On Wed, 2003-10-22 at 11:28, Johan Eliasson wrote:
> I tried to send this mail from my other mailadress but it
> didn't seem to work so I'm trying again now!
SourceForge's mailservers are not always the fastest, so things can take
some time. Your message did arrive, just a little later.
> Hello,
>
> I have been looking at openSG for a while now and I have some
> questions. I am using windows 2000 with
> visual studio .net 2002
>
> First I think the documentation available for download
> http://www.opensg.org/downloads/OpenSG-1.2.0-srcdoc.tgz
> is corrupt. Can someone verify if this is so?
Corrupt in what sense? i can download and decompress it just fine, and
it seems to be ok to me. What makes you think it's corrupt?
> When I try to compile openSG from the OpenSG-1.2.0-src.tgz
> file (from VSbuild\VS7) first I get some out of heap space
> errors,
These are caused by the VS7 IDE. It works fine when just using the
compiler, so they're harmless.
> then I get an error that I need a file called
> freetype.h so I download something called freetype. But then
> I get a bunch of other error messages. Is there a list of
> what is needed? Or is it supposed to work? Maybe I got the
> wrong version of freetype?
Probably. We use Freetype 1, most of the packages out there use 2. In
general you're probably better off using a binary distribution instead
of compiling it yourself. If you need something that is not supported in
the officiel releases yet you can daily up-to-date version from
www.opensg.org/dailybuild_logs.
> Since I only need to modify a few files maybe I don't need to
> compile the whole OpenSG. How can I use modified files without
> compiling OpenSG? I've tried to make my own version of
> SimpleSceneManager (just putting it in my project directory)
> but I get the error:
>
> "error C2491: 'osg::SimpleSceneManager::_highlightMaterial' :
> definition of dllimport static data member not allowed"
That's due to MS messing around with the C++ language. It's a long story
that you probably don't want to mess with. If you really need to you can
derive from SimpleSceneManager instead of copying it.
> Now to what I'm actually trying to do:
>
> I need to use vertex and pixel shaders. Is there any support
> for Cg? That would help me a lot.
There is, but as CG is not available everywhere it is not compiled into
the default libraries. It is part of the Contrib library, but to compile
that you would have to use Cygwin, we don't have a VS Workspace for it.
> I've tried to take a look at
> the test program for the vertexProgram but I can't figure out
> how the parameters are passed to the program. It seems like the
> material properties are passed directly to the vertex program.
> Is there a way to manually say what is passed to the program or
> is it explained somewhere how it works?
The Vertex Program using ARB_vertex_program can access most of the
standard OpenGL state directly, so there's no need to pass that as a
parameter. You can pass parameters for your own values via the
ProgramChunk, the testVertexProgramRender.cpp adds three parameters that
can be accessed inside the VP.
> I'm trying to add glow to emissive materials in my models. This
> I plan to do by first drawing the scene with only the emissive
> parts to a secondery buffer then copying the buffer to a texture
> and then blurring the texture by running it through a vertex and
> fragment program a few times. When I finally have the blurred
> texture I want to apply it to the original scene using blend
> filter. (Just drawing a texture on top of the scene)
> Can StereoBufferViewport be used for the extra buffer I need?
No, the StereoBufferViewport is used for three-dimensional display using
active stereo.
> And can I get the scene from the second buffer as a texture
> by using GrabForeground?
Yup, that's the way to go.
> I realize I get an osg::Image from
> the grabforground, can this Image be used as a texture in
> the sense that it can be passed to the vertex program as a
> parameter?
Yes and no. Texture are not parameters of VPs, they are just part of the
OpenGL state when a VP or FP (fragment Program) is executed. As such
they are part of the Material that the VP is attached to.
> Is there any problems regarding the rendering of
> multiple passes or is it just to do each step, one at a time?
It's not as nice to do that as I would like it to be. Yet. If you want
to do what you describe you will probably have to have multiple
viewports with different settings.
> One last thing I need is to be able to draw a texture to the
> foreground. For this I would also like to use a vertex program.
> I need the vertexprogram to rotate and resize the polygon that
> the texture is rendered on. This is the same as I mentioned before
> except that the texture doesn't cover the the whole viewport this
> time. I would need something that works like gluOrtho2D. Is there
> anything like this in openSG or what should I do?
I'm not sure I understand what you're trying to do here, but you can
have Viewports that don't cover the whole Window. But it's probably
easier to just render the polygon in the right size instead of fiddling
with Viewports here.
I think a good start for what you're trying to do are
testWindowGLUTTGF.cpp and testDynamicCubeReflectionRender.cpp. Both of
them create new viewports and grab their contents into a texture to work
with it later in the main viewport.
The kind of post-processing effect that you're trying to do is not
something we have done before, that's why it's more difficult to do than
I would like it to be. But it's doable.
Hope it helps
Dirk
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users