Irrlicht + cocos2d code discussion on ios

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Re: Irrlicht + cocos2d code discussion on ios

Post by feelthat »

scroll view and table view in GUI done

i use this example test ok
http://www.cnblogs.com/jeekun/p/3182032.html

char helpstr[30] = {0}; //this line need replace before bool bRet = false;

download here
http://download.csdn.net/download/zhoujianghai/4975604
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Irrlicht + cocos2d code ios and android

Post by feelthat »

here is demo for ios and android scrollview GUI on Irrlicht 3D
https://plus.google.com/photos/10618554 ... 8774360364

https://github.com/fatalfeel/proton_cm_open
feelthat wrote:scroll view and table view in GUI done

i use this example test ok
http://www.cnblogs.com/jeekun/p/3182032.html

char helpstr[30] = {0}; //this line need replace before bool bRet = false;

download here
http://download.csdn.net/download/zhoujianghai/4975604
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Re: Irrlicht + cocos2d code discussion on ios

Post by feelthat »

opengl/ogles1/ogles2 on win32, on ogles1/ogles2 on android, ogles1/ogles2 on ios, opengl on MacOs

demo here
https://plus.google.com/photos/10618554 ... 8156528913


https://github.com/fatalfeel/proton_cm_open
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Re: Irrlicht + cocos2d code discussion on ios

Post by feelthat »

I found libGLESv2.dll bug in win32 ogles2 on angleproject

Checkout
git clone https://chromium.googlesource.com/angle/angle

angleproject git base is
Revision: cc4ec64cda54f4b138f8d16ce0fe40b8fcedb459
Author: Zhenyao Mo <zmo@chromium.org>
Date: 2013/9/24 上午 02:57:10
Message:
Use the same mechanism to process int/float literals

///

bug is [uniform int] can not calculate with [int]

uniform int uLightCount;

int k = uLightCount; //failed
int k = 2; //successful

for (int i = 0; i < k; i++)
{
if (uLightType == 0)
pointLight(i, Position, Normal, Ambient, Diffuse, Specular);
}

I will try to modify it~
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Re: Irrlicht + cocos2d code discussion on ios

Post by feelthat »

// libGLESv2.dll bug in win32 ogles2 on angleproject
// http://www.mediafire.com/download/8v4df ... eGLes2.rar

bool ProgramBinary::setUniform1iv(GLint location, GLsizei count, const GLint *v)
{
...
...
...
if (targetUniform->type == GL_INT || IsSampler(targetUniform->type))
{
//GLint *target = (GLint*)targetUniform->data + mUniformIndex[location].element * 4;
GLint *target = (GLint*)targetUniform->data;
target = target + mUniformIndex[location].element * 4;

for (int i = 0; i < count; i++)
{
target[0] = v[0];
target[1] = 0;
target[2] = 0;
target[3] = 0;
target += 4;
v += 1;
}
}
...
...
...
}

void Renderer9::applyUniformniv(gl::Uniform *targetUniform, const GLint *v)
{
ASSERT(targetUniform->registerCount <= MAX_VERTEX_CONSTANT_VECTORS_D3D9);
GLfloat vector[MAX_VERTEX_CONSTANT_VECTORS_D3D9][4];

for (unsigned int i = 0; i < targetUniform->registerCount; i++)
{
vector[0] = (GLfloat)v[4 * i + 0];
vector[1] = (GLfloat)v[4 * i + 1];
vector[2] = (GLfloat)v[4 * i + 2];
vector[3] = (GLfloat)v[4 * i + 3];
}

applyUniformnfv(targetUniform, (GLfloat*)vector);
}

I trace target[0] will send to vector[0]


now i will up load better version of libGLESv2.dll and modify .vsh

work good now~~~~
Last edited by feelthat on Mon Jun 29, 2015 2:16 am, edited 1 time in total.
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Re: Irrlicht + cocos2d code discussion on ios

Post by feelthat »

here is the way to change .vsh
http://www.atmind.nl/?p=623
feelthat
Posts: 194
Joined: Sat Feb 02, 2013 5:27 am

Re: Irrlicht + cocos2d code discussion on ios

Post by feelthat »

d3d9.dll bug report on angelproject' libGLESv2.dll

//GLSL file .vsh
for (i = 0; i < int(uLightCount); i++)

// transfer to HLSL
{for((_i = 0); (_i < ivec1(_uLightCount)); (_i++))

//libGLESv2.dll do this transfer here
bool OutputHLSL::visitAggregate

case EOpConstructInt:
addConstructor(node->getType(), "ivec1", node->getSequence());
outputTriplet(visit, "ivec1(", "", ")");
break;

//////////////
and ProgramBinary::setUniform1iv
target[0] = v[0];

send to Renderer9::applyUniformniv

//int to float
vector[0] = (GLfloat)v[4 * i + 0];

//then set float vec1 to d3d9.dll
mDevice->SetVertexShaderConstantF(targetUniform->vsRegisterIndex, v, targetUniform->registerCount);

////
d3d9.dll can not set float vec1 to int variable

so the for (i = 0; i < int(uLightCount); i++) will fail

/// this way will be ok~~~

for (i = 0; i < int(MAX_LIGHTS); i++)
{
if( i >= uLightCount )
break;
...
...
...
}
Post Reply