Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-20 Thread Grigoriy Mylnikov
Thank you, it works. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=75222#75222 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-20 Thread Chris Hanson
http://alphapixel.com/faqs/ src\osgUtil\SceneView.cpp(422): osg::Uniform* uniform = _localStateSet->getOrCreateUniform(“osg_ViewMatrix”,osg::Uniform::FLOAT_MAT4); src\osgUtil\SceneView.cpp(428): osg::Uniform* uniform =

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-20 Thread Grigoriy Mylnikov
Hi, One more question. If I use gl_ModelViewMatrix in shaders to transform Light position, it gets transformed by both camera matrix and current node's matrix, that is not right. Is there some build-in OSG uniform that holds only camera matrix or only model matrix? Or I should compute it and

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-19 Thread Chris Hanson
Let me check with Thomas. On Mon, Nov 19, 2018 at 5:46 PM Grigoriy Mylnikov wrote: > At the moment, I implemented ShaderLight class that extends osg::Light and > allows to use several point lights with per-pixel lighting (using my > shaders). It works on android emulator. > > I'm not sure about

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-19 Thread Grigoriy Mylnikov
At the moment, I implemented ShaderLight class that extends osg::Light and allows to use several point lights with per-pixel lighting (using my shaders). It works on android emulator. I'm not sure about where is a best place to add that lights' uniforms to scene graph (e.g.

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-18 Thread Grigoriy Mylnikov
I tried to use osgUtil/ShaderGen. As far as I understand, it does not supports GLES2/3: it references gl_LightSource, gl_FrontLightProduct etc. in shader code, and I could not find such uniforms created. Also, it assumes only one light source. Maybe there is some more advanced version of

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-16 Thread Grigoriy Mylnikov
After some trial and errors, I managed to do it in shader. But this means one redundant matrix multiplication per each vertex. Isn't it more effective to compute it once per frame on cpu side? What's the purpose of state.getModelViewMatrix()? I expected to get a camera*model matrix there. Or

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-16 Thread Werner Modenbach
Hi Grigoriy, why don't you do the multiply in the shader like you do with gl_vertex? - Werner - Am 16.11.2018 um 12:29 schrieb Grigoriy Mylnikov: > Sorry for delayed reply. > > My goal is to open and display .osgt files on android the same way they can > be opened on desktop. This includes

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-16 Thread Grigoriy Mylnikov
Sorry for delayed reply. My goal is to open and display .osgt files on android the same way they can be opened on desktop. This includes using several lights inside a model, both directional and point lights. I have some progress with writing shaders, but I have troubles with understanding

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-12 Thread Chris Hanson
I think the osgUtil/ShaderGen code might be GLES2 compatible now. Try running it on your model, and dump the shader that it creates to see if it's creating Uniforms for lighting or not. It might or might not be using the osg::Light as a basis. Do you HAVE to use osg::Light or could you get by

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2018-11-12 Thread Grigoriy Mylnikov
Hi, Is this issue solved in OSG somehow? I need to use some basic lighting on Android (GLESv3). It should use parameters from osg::Light. Are there any ready-made solutions? if not, where can I get some shaders/shader generator to start with? I'm new in shaders. Thank you! Cheers, Grigoriy

[osg-users] OpenGL ES 2.0 and LIGHTING

2012-06-12 Thread John Moore
Hi, I am developing an application for iPhone and iPod touch using OpenSceneGraph. In origin I written my own shaders and I used to control light using a uniform. It was working. Now I wanted to switch to use osg::Light and osg::LightSource because I think it is more object-oriented, but when

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2012-06-12 Thread Jordi Torres
Hi John, You need use your own shaders as GLES2 does not support materials or OpenGL lighting. AFAIK shader generator to emulate fixed pipeline is a work in progress, but it's not completed yet. Cheers. 2012/5/27 John Moore kahar...@gmail.com Hi, I am developing an application for iPhone

Re: [osg-users] OpenGL ES 2.0 and LIGHTING

2012-06-12 Thread Chris Hanson
On Sun, May 27, 2012 at 10:45 AM, John Moore kahar...@gmail.com wrote: Hi, I am developing an application for iPhone and iPod touch using OpenSceneGraph. In origin I written my own shaders and I used to control light using a uniform. It was working. Now I wanted to switch to use osg::Light