Page 23 of 28

Re: The latest SVN bugs thread

Posted: Sun Dec 21, 2014 2:50 am
by Ovan
Plop!

don't know if you forget it, but the following line seem to be missing on COpenGLExtensionHandler.cpp at line 767

case EVDF_PIXEL_SHADER_3_0:
case EVDF_VERTEX_SHADER_3_0:
return Version>=300;

with, the query driver feature seem to work

Re: CMeshBuffer append does nothing

Posted: Mon Dec 22, 2014 7:37 pm
by chronologicaldot
Foaly wrote:Hello!

Maybe this is a bad question, but why does append in CMeshBuffer do nothing? Inside is just a comment.
I recently tried to create some auto batching for a project and had to find out (after trying a long time), that it can't work, because the mesh buffer simply ignores it.

Thanks in advance for an answer and maybe a fix?
Delayed answer here.

The CMeshBuffer::append() does nothing because there is no guarantee that the vertex types will be the same (or at least, there wasn't a way to tell when that function was written), so the functionality was removed. However, the workaround is casting your IMeshBuffer to CMeshBuffer and accessing the vertices directly. From there, you can push_back the individual vertices if you have to.

Code: Select all

 
((SMeshBuffer*)mesh->getMeshBuffer(0))->Vertices.push_back( S3DVertex() );
 
Edit: I take that back - it's the other append() that's missing the body. In that case, just use IMeshBuffer::getVertices() and throw them into the other append function.

Re: Android Port

Posted: Tue Jan 27, 2015 4:07 pm
by feelthat
bug reoprt in ios 7.1 iphone 4 and ios simulator 7.1
but I test in Htc android is Good

follows can not show image on a button, because glEnable(GL_SCISSOR_TEST) will wrong

video::ITexture* image;
gui::IGUIButton* btn;
video::IVideoDriver* driver = IrrlichtManager::GetIrrlichtManager()->GetDriver();
gui::IGUIEnvironment* gui = device->getGUIEnvironment();
core::dimension2d<u32> screen = driver->getScreenSize();

#ifdef __APPLE__
image = driver->getTexture((GetBaseAppPath()+"game/ar_up.png").c_str());
btn = gui->addButton(core::rect<int>(85,screen.Height-300,155,screen.Height-230), NULL, GUI_ID_BUTTON_DIR_FORWARD);
btn->setImage(image);
btn->setUseAlphaChannel(true);
btn->setDrawBorder(false);
#endif

//////////////////////////
////////////
//////
fixed in cguibutton::draw()

if (!Pressed)
{
if (DrawBorder)
skin->draw3DButtonPaneStandard(this, AbsoluteRect, &AbsoluteClippingRect);

if (Image)
{
core::position2d<s32> pos = spritePos;
pos.X -= ImageRect.getWidth() / 2;
pos.Y -= ImageRect.getHeight() / 2;

driver->draw2DImage(Image,
ScaleImage? AbsoluteRect :
core::recti(pos, ImageRect.getSize()),
ImageRect,
#ifdef __APPLE__
NULL, //by stone, avoid ios run glEnable(GL_SCISSOR_TEST) bug
#else
&AbsoluteClippingRect,
#endif
0,
UseAlphaChannel);
}
}
else
{
if (DrawBorder)
skin->draw3DButtonPanePressed(this, AbsoluteRect, &AbsoluteClippingRect);

if (PressedImage)
{
core::position2d<s32> pos = spritePos;
pos.X -= PressedImageRect.getWidth() / 2;
pos.Y -= PressedImageRect.getHeight() / 2;

if (Image == PressedImage && PressedImageRect == ImageRect)
{
pos.X += skin->getSize(EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X);
pos.Y += skin->getSize(EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y);
}

driver->draw2DImage(PressedImage,
ScaleImage? AbsoluteRect :
core::recti(pos, PressedImageRect.getSize()),
PressedImageRect,
#ifdef __APPLE__
NULL, //by stone, avoid ios run glEnable(GL_SCISSOR_TEST) bug
#else
&AbsoluteClippingRect,
#endif
0,
UseAlphaChannel);
}
}

Re: Android Port

Posted: Fri Jan 30, 2015 6:38 pm
by feelthat
bug report on ios 7.1 and android, not fix, if anyone free plz improve it.

in QuakeShaderMenu example have the problem in flame1~9.jpg texture

OGLES1 good
https://picasaweb.google.com/1061855410 ... 9986155154

OGLES2 can not show
https://picasaweb.google.com/1061855410 ... 9792019042

///
in CQuake3ShaderSceneNode::getRenderStage()

else if ( strstr ( Shader->name.c_str(), "flame" ) ||
group->isDefined( "surfaceparm", "water" ) ||
group->isDefined( "sort", "underwater" ) ||
group->isDefined( "sort", "underwater" )
)
{
ret = ESNRP_TRANSPARENT_EFFECT; //here
}

//modify this will show the fire flame texture
ret = ESNRP_TRANSPARENT_EFFECT; -> ret = ESNRP_SOLID;

//
//drawall will render this fire flame
TransparentNodeList.Node->render();


I guess its a TRANSPARENT problem

Re: Android Port

Posted: Fri Jan 30, 2015 9:31 pm
by feelthat
fixed ok

http://forge.opensimulator.org/gf/proje ... &pathrev=3

case 14:
// alphafunc ge128
//blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; //change here
blendfunc.param0 = 0.5f;
blendfunc.isTransparent = 1;
resolved = 1;
break;

//bug report on ios 7.1 and android, not fix, if anyone free plz improve it.
//in QuakeShaderMenu example have the problem in flame1~9.jpg texture

Re: Android Port

Posted: Tue Feb 03, 2015 3:53 pm
by CuteAlien
Hi feelthat, I've taken a look at the change for alphafunc ge128. My guess so far would be that EMT_TRANSPARENT_ALPHA_CHANNEL is correct - but the shader is wrong. Do you maybe have a format description for the q3 format?

Re: Android Port

Posted: Tue Feb 03, 2015 4:05 pm
by CuteAlien
OK, it seems uAlphaRef is not yet used at all in the shader so far (that parameter is needed for this). I think EMT_TRANSPARENT_ALPHA_CHANNEL shouldn't use COGLES2Solid.fsh but an own shader as that parameter doesn't makes sense for other solid's. Maybe also an own callback as COGLES2MaterialSolidCB always does pass that on (thought might not hurt to use that - it does that so far without ill effect it seems).

Re: Android Port

Posted: Tue Feb 03, 2015 4:21 pm
by CuteAlien
@feelthat: I've added a new fragment shader for EMT_TRANSPARENT_ALPHA_CHANNEL which will solve the problem in the q3 map. It's not yet 100% correct (can't control alpha-sharpness yet), but works for this case.

Re: Android Port

Posted: Tue Feb 03, 2015 5:32 pm
by feelthat
thanks a lot man~~~feel warm

///////////////////////////
//another way is in IQ3Shader.h

inline static void getBlendFunc
{
.
.
.
case 14:
// alphafunc ge128
//blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; //modify here
blendfunc.param0 = 0.5f;
blendfunc.isTransparent = 1;
resolved = 1;
break;
.
.
.
}

////
in old version of irrlich 2009
http://sourceforge.jp/projects/irrlicht ... Q3Shader.h
they use blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF

in old version of irrlich 2008
http://forge.opensimulator.org/gf/proje ... athrev=140
they use blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF

CuteAlien wrote:@feelthat: I've added a new fragment shader for EMT_TRANSPARENT_ALPHA_CHANNEL which will solve the problem in the q3 map. It's not yet 100% correct (can't control alpha-sharpness yet), but works for this case.

Re: Android Port

Posted: Tue Feb 03, 2015 8:55 pm
by feelthat
example from
https://github.com/fatalfeel/proton_sdk ... game/quake
or
7zip extract map-20kdm2.pk3 in irrlicht media

file is
C:\proton_sdk_git\RT3DApp\media\game\quake\scripts\models.shader

content is
models/mapobjects/timlamp/timlamp
{
cull disable
surfaceparm alphashadow
{
map models/mapobjects/timlamp/timlamp.tga
alphaFunc GE128
depthWrite
rgbGen vertex
}
}

CuteAlien wrote:Hi feelthat, I've taken a look at the change for alphafunc ge128. My guess so far would be that EMT_TRANSPARENT_ALPHA_CHANNEL is correct - but the shader is wrong. Do you maybe have a format description for the q3 format?

Re: Android Port

Posted: Thu Feb 05, 2015 6:52 am
by feelthat
I guess its a .tga problem

use photoshop open tga, it have alpha 1 channel

but png don't have, png is a pure transparent image

CuteAlien wrote:@feelthat: I've added a new fragment shader for EMT_TRANSPARENT_ALPHA_CHANNEL which will solve the problem in the q3 map. It's not yet 100% correct (can't control alpha-sharpness yet), but works for this case.

Re: Android Port

Posted: Thu Feb 05, 2015 2:04 pm
by CuteAlien
@feelthat: Not yet tried your file as you don't say what I should expect from it. Will it show another bug? Or a problem with the bugfix which I've checked in? Please use a little bit more words when discussing problems :-)

Re: Android Port

Posted: Sun Feb 08, 2015 5:47 pm
by CuteAlien
@feelthat: I still don't understand you. Do you mean that the fix I added does not work? Or did you not try with that?

Re: Android Port

Posted: Mon Feb 09, 2015 7:11 am
by feelthat
I mean you work fine and good fixed the bug!!!
but I use another way fixed the bug too, the way is modify IQ3Shader.h

two way both fixed the bug!!!
CuteAlien wrote:@feelthat: I still don't understand you. Do you mean that the fix I added does not work? Or did you not try with that?

Re: Android Port

Posted: Mon Feb 09, 2015 2:04 pm
by CuteAlien
feelthat wrote:two way both fixed the bug!!!
OK :-)