Re: [osg-users] osgjs fix for 64 builds with some compilers

2016-02-18 Thread Robert Osfield
On 18 February 2016 at 10:36, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Hi Robert,
>
> since this is one line and related to output info maybe this will be
> enough to work on both platforms
>
> ss << (int64_t)image << ".inline_conv_generated.png"; // write the
> pointer location
>

I have applied this change and checked it into master and OSG-3.4 branch.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgjs fix for 64 builds with some compilers

2016-02-18 Thread Trajce Nikolov NICK
Hi Robert,

since this is one line and related to output info maybe this will be enough
to work on both platforms

ss << (int64_t)image << ".inline_conv_generated.png"; // write the pointer
location

On Thu, Feb 18, 2016 at 11:21 AM, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Hi Robert,
>
> I did fast fix hoping you will find a time to comment on this. I agree
> with you .. Let me try to do it more properly :)
>
> Thanks for finding a time to look at the issue!
>
> Cheers,
> Nick
>
> On Thu, Feb 18, 2016 at 10:45 AM, Robert Osfield  > wrote:
>
>> Hi Nick,
>>
>> I have just reviewed your change and don't feel it's the appropriate way
>> to tackle this type of issue.  If long int isn't being interpreted as 64bit
>> int then it would be appropriate to use a typedef rather than #ifdef
>> blocks.  The include/osg/Types file contains int64_t, could you just try
>> this instead?
>>
>> Robert.
>>
>> On 29 January 2016 at 10:26, Trajce Nikolov NICK <
>> trajce.nikolov.n...@gmail.com> wrote:
>>
>>> Hi Robert,
>>>
>>> attached is small fix for 64 builds with some compilers. It is from the
>>> 3.5.1 dev release. Is there a chance to integrate this fix into the
>>> mentioned version?
>>>
>>> Was tested with MSVC and g++
>>>
>>> --
>>> trajce nikolov nick
>>>
>>> ___
>>> 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
>>
>>
>
>
> --
> trajce nikolov nick
>



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


Re: [osg-users] osgjs fix for 64 builds with some compilers

2016-02-18 Thread Trajce Nikolov NICK
Hi Robert,

I did fast fix hoping you will find a time to comment on this. I agree with
you .. Let me try to do it more properly :)

Thanks for finding a time to look at the issue!

Cheers,
Nick

On Thu, Feb 18, 2016 at 10:45 AM, Robert Osfield 
wrote:

> Hi Nick,
>
> I have just reviewed your change and don't feel it's the appropriate way
> to tackle this type of issue.  If long int isn't being interpreted as 64bit
> int then it would be appropriate to use a typedef rather than #ifdef
> blocks.  The include/osg/Types file contains int64_t, could you just try
> this instead?
>
> Robert.
>
> On 29 January 2016 at 10:26, Trajce Nikolov NICK <
> trajce.nikolov.n...@gmail.com> wrote:
>
>> Hi Robert,
>>
>> attached is small fix for 64 builds with some compilers. It is from the
>> 3.5.1 dev release. Is there a chance to integrate this fix into the
>> mentioned version?
>>
>> Was tested with MSVC and g++
>>
>> --
>> trajce nikolov nick
>>
>> ___
>> 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
>
>


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


Re: [osg-users] osgjs fix for 64 builds with some compilers

2016-02-18 Thread Robert Osfield
Hi Nick,

I have just reviewed your change and don't feel it's the appropriate way to
tackle this type of issue.  If long int isn't being interpreted as 64bit
int then it would be appropriate to use a typedef rather than #ifdef
blocks.  The include/osg/Types file contains int64_t, could you just try
this instead?

Robert.

On 29 January 2016 at 10:26, Trajce Nikolov NICK <
trajce.nikolov.n...@gmail.com> wrote:

> Hi Robert,
>
> attached is small fix for 64 builds with some compilers. It is from the
> 3.5.1 dev release. Is there a chance to integrate this fix into the
> mentioned version?
>
> Was tested with MSVC and g++
>
> --
> trajce nikolov nick
>
> ___
> 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


[osg-users] osgjs fix for 64 builds with some compilers

2016-01-29 Thread Trajce Nikolov NICK
Hi Robert,

attached is small fix for 64 builds with some compilers. It is from the
3.5.1 dev release. Is there a chance to integrate this fix into the
mentioned version?

Was tested with MSVC and g++

-- 
trajce nikolov nick
#include "WriteVisitor"
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include "Base64"

#if defined(_M_X64) || defined(__amd64__)
	#define BUILD_64BIT 1
#endif




osg::Array* getTangentSpaceArray(osg::Geometry& geometry) {
for(unsigned int i = 0 ; i < geometry.getNumVertexAttribArrays() ; ++ i) {
osg::Array* attribute = geometry.getVertexAttribArray(i);
bool isTangentArray = false;
if(attribute && attribute->getUserValue("tangent", isTangentArray) && isTangentArray) {
return attribute;
}
}
return 0;
}

void translateObject(JSONObject* json, osg::Object* osg)
{
if (!osg->getName().empty()) {
json->getMaps()["Name"] = new JSONValue(osg->getName());
}

osgSim::ShapeAttributeList* osgSim_userdata = dynamic_cast(osg->getUserData());
if (osgSim_userdata) {
JSONObject* jsonUDC = new JSONObject();
jsonUDC->addUniqueID();

JSONArray* jsonUDCArray = new JSONArray();
jsonUDC->getMaps()["Values"] = jsonUDCArray;
for (unsigned int i = 0; i < osgSim_userdata->size(); i++) {
const osgSim::ShapeAttribute& attr = (*osgSim_userdata)[i];
JSONObject* jsonEntry = new JSONObject();
jsonEntry->getMaps()["Name"] = new JSONValue(attr.getName());
osg::ref_ptr value;
switch(attr.getType()) {
case osgSim::ShapeAttribute::INTEGER:
{
std::stringstream ss;
ss << attr.getInt();
value = new JSONValue(ss.str());
}
break;
case osgSim::ShapeAttribute::DOUBLE:
{
std::stringstream ss;
ss << attr.getDouble();
value = new JSONValue(ss.str());
}
break;
case osgSim::ShapeAttribute::STRING:
{
std::stringstream ss;
ss << attr.getString();
value = new JSONValue(ss.str());
}
break;
case osgSim::ShapeAttribute::UNKNOWN:
default:
break;
}
jsonEntry->getMaps()["Value"] = value;
jsonUDCArray->getArray().push_back(jsonEntry);
}
json->getMaps()["UserDataContainer"] = jsonUDC;

} else if (osg->getUserDataContainer()) {
JSONObject* jsonUDC = new JSONObject();
jsonUDC->addUniqueID();

if (!osg->getUserDataContainer()->getName().empty()) {
jsonUDC->getMaps()["Name"] = new JSONValue(osg->getUserDataContainer()->getName());
}
JSONArray* jsonUDCArray = new JSONArray();
jsonUDC->getMaps()["Values"] = jsonUDCArray;
for (unsigned int i = 0; i < osg->getUserDataContainer()->getNumUserObjects(); i++) {
osg::Object* o = osg->getUserDataContainer()->getUserObject(i);
std::string name, value;
getStringifiedUserValue(o, name, value);
if(!name.empty() && !value.empty())
{
JSONObject* jsonEntry = new JSONObject();
jsonEntry->getMaps()["Name"] = new JSONValue(name);
jsonEntry->getMaps()["Value"] = new JSONValue(value);
jsonUDCArray->getArray().push_back(jsonEntry);
}

}
json->getMaps()["UserDataContainer"] = jsonUDC;
}
}


void getStringifiedUserValue(osg::Object* o, std::string& name, std::string& value) {
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
if(getStringifiedUserValue(o, name, value)) return;
}


template
bool getStringifiedUserValue(osg::Object* o, std::string& name, std::string& value) {
osg::TemplateValueObject* vo = dynamic_cast< osg::TemplateValueObject* >(o);
if (vo) {
std::ostringstream oss;
oss << vo->getValue();
name = vo->getName();
value = oss.str();
return true;
}
return false;
}


static JSONValue* getBlendFuncMode(GLenum mode) {
switch (mode) {
case osg::BlendFunc::DST_ALPHA: return new JSONValue("DST_ALPHA");
case osg::BlendFunc::DST_COLOR: return new JSONValue("DST_COLOR");
case osg::BlendFunc::ONE: return new JSONValue("ONE");
case osg::BlendFunc::ONE_MINUS_DST_ALPHA: 

[osg-users] osgjs-plugin / opengl es

2011-11-24 Thread Cedric Pinson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I refactored the osgjs-plugin and I thought that it could interest
people working with opengl es. webgl is built ontop of opengles so
optimization work for both.
Maybe the part that split models into 64k drawelements, merge tristrip
into one with degenerate triangle could be separated and submitted as
pseudo loader.
I am just submitting the idea to check if other guys are interested.

The code is
https://github.com/cedricpinson/osg/tree/master/src/osgPlugins/osgjs

I wrote a simple post to lists options
http://osgjs.org/2011/11/osgjs-plugin-optimizations/

Cedric

- -- 
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/

iEYEARECAAYFAk7OcdsACgkQs6ZHzVQN0IifegCgkGgGbkWKox116Wura7MyFxWj
DosAn2ie4WEG3/B7CfOdGWSG2vnd61ax
=kZun
-END PGP SIGNATURE-
___
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


[osg-users] osgjs - Light

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

Hi,

osg.Light has changed in the trunk. Now the StateAttribute compute
lighting per pixel and support Directional/Point/Spot light.

An example should come quickly to demonstrate it.

Cheers,
Cedric

- -- 
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/

iEYEARECAAYFAk6JnQEACgkQs6ZHzVQN0IhJoACdGSNEiAD1FP8V88qOFoPEeO/O
+jsAoJGEoMb4vIFiVcS0Mcps8VXInQ9n
=u5LD
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgjs - osgUtil.ShaderParameterVisitor

2011-09-16 Thread Cedric Pinson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I added in osgjs a new visitor to help to fine tune shader parameters.
The visitor look for program in the scenegraph and extract uniforms.
Then it bind html slider (chrome) to modify uniform value.
For more convenience uniform value are stored in localStorage and
reloaded. It misses some part like looking for existing uniform instead
of creating new one...

see a simple example http://osgjs.org/osgjs/examples/fog/index.html

The visitor is in early development and guess some bugs :)

Cedric

- -- 
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/

iEYEARECAAYFAk5zO8EACgkQs6ZHzVQN0IivVwCfUAGcIgrn5VdgD6DgTNKLcfqA
ruoAmgK4z3Q/604WOWQw0A8XN89vObw3
=0Bp4
-END PGP SIGNATURE-

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


[osg-users] osgjs

2011-03-29 Thread Cedric Pinson
Hi,
I wanted to share improvement done on osgjs the last few months. It has
been used for a firefox demo you can watch
https://demos.mozilla.org/en-US/#globetweeter or
http://plopbyte.com:2048/globetweeter/ if the previous server is
overloaded.

If you are interested by the project look on the http://osgjs.org blog


Cedric

-- 
Provide OpenGL, WebGL and OpenSceneGraph services
+33 659 598 614 Cedric Pinson mailto:cedric.pin...@plopbyte.com
http://plopbyte.com


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgjs

2011-03-29 Thread David Callu
Hi Cedric,

Really funny app.
Good Idea, Good Job.

See you
David


2011/3/29 Cedric Pinson cedric.pin...@plopbyte.com

 Hi,
 I wanted to share improvement done on osgjs the last few months. It has
 been used for a firefox demo you can watch
 https://demos.mozilla.org/en-US/#globetweeter or
 http://plopbyte.com:2048/globetweeter/ if the previous server is
 overloaded.

 If you are interested by the project look on the http://osgjs.org blog


 Cedric

 --
 Provide OpenGL, WebGL and OpenSceneGraph services
 +33 659 598 614 Cedric Pinson mailto:cedric.pin...@plopbyte.com
 http://plopbyte.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