Hi,

I heard of some work being done to support automatic shaders (in private
talks, not sure I'm allowed to provide further details), which
transparently emulate fixed pipeline for osg, but not sure of it's state or
when it will be available to public,

currently osgUtil ShaderGen is a way to start with  and also
osgEarth/ShaderGenerator.cpp might be of some help.

Regards
Sergey

On Thu, Nov 13, 2014 at 3:44 PM, Liu Xiao <[email protected]> wrote:

> Hi,
> I would like to try the osgjs plugin. But as my application need to show
> all fbx files users provide. I cannot write shaders for every 3d models.
>
> Is there anyway I can do this?
>
> Thanks!
>
>
> Sergey Kurdakov wrote:
> > Hi Liu,
> >
> >
> > as you already indicated in other posts - you have read my advice to
> other people in this situation
> > And here I repeat it use Cedrik Pinson osgjs format ( exporter for osg
> converter  is here
> https://github.com/cedricpinson/osg/tree/master/src/osgPlugins/osgjs (
> https://github.com/cedricpinson/osg/tree/master/src/osgPlugins/osgjs) )
> it looks very suitable for  OpenGL ES 2.0 models. To use it, though, you
> will need to write your own loader
> >
> >
> >
> >
> >
> > Regards
> > Sergey
> >
> > On Mon, Nov 10, 2014 at 1:23 PM, Liu Xiao < ()> wrote:
> >
> > > Thanks ! That is really a simple and nice example for me, I will try
> it and feedback when I get succeed.
> > >
> > > I think your solution is loading texture separatly , while my osg file
> is binding with texture. I donot know how to convert fbx to osg format for
> external texture file.
> > >
> > > However, the following shader works for my young.osg file here :
> > >
> > >
> > > Code:
> > >     static const char gVertexShader1[] =
> > >     "varying vec2 v_texCoord;
>  n"
> > >     "void main() {
>       n"
> > >     "    gl_Position  = gl_ModelViewProjectionMatrix * gl_Vertex;
>      n"
> > >     "         v_texCoord   = gl_MultiTexCoord0.xy;
>                                     n"
> > >     "}
>   n";
> > >
> > >     static const char gFragmentShader1[] =
> > >     "varying  mediump vec2 v_texCoord;
>                                   n"
> > >     "uniform sampler2D sam;
>                                                             n"
> > >     "void main() {
>                                                                     n"
> > >     "gl_FragColor = texture2D(sam, v_texCoord);
>                                                 n"
> > >     "}
> > >
> > >
> > >
> > >
> > >
> >
> >
> >  ------------------
> > Post generated by Mail2Forum
>
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=61618#61618
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to