renderTexture 3.0-Beta quarter size problem

Hi,

I’m still a newbie using cocos2dx, especially when it is coming to renderTexture. Anyhow, checked a lot of different options and finally need to seek for help.

I’m using cocos2dx-3.0-Beta, fiddling around with renderTexture. So far, I was able to create a renderTexture and even apply shaders to it, using the texture from renderTexture and bring it to the screen. Problem is, that the texture is only quarter size of the screen (see screenshot, please).

But at no point, I told to resize the renderTexture nor the renderTexture->sprite nor the sprite I’m copying the texture to.

Some Snippets:

//creating the renderTexture _visibleSize = Director::getInstance()->getVisibleSize(); _visibleOrigin = Director::getInstance()->getVisibleOrigin(); _renderTexture = RenderTexture::create(_visibleSize.width, _visibleSize.height); _renderTexture->retain();

// visit _renderTexture->beginWithClear(1.0,1.0,1.0,0.5); this->visit(); _renderTexture->end();

// init shader and GLProgram* shader = new GLProgram(); shader->initWithVertexShaderFilename("vert.vsh", "frag.fsh"); _liquidSprite = Sprite::create("empty.png",CCRectMake(0, 0, _visibleSize.width, _visibleSize.height)); _liquidSprite->cocos2d::Node::setPosition(ccp(_visibleSize.width/2, _visibleSize.height/2)); _liquidSprite->setScaleY(-1); //to remove vertical mirroring _liquidSprite->setShaderProgram(shader); shader->addAttribute("a_position", kCCVertexAttrib_Position); shader->addAttribute("a_texCoord", kCCVertexAttrib_TexCoords); shader->link(); shader->updateUniforms(); shader->use(); _liquidLayer->addChild(_liquidSprite); this->addChild(_liquidLayer);

Is that a Beta issue? I need to admit, that I didn’t use renderTextures before 3.0-Beta. In first instance after checking the values, I thought it might be related to Retina. But in iPad (non-Retina) Simulator it is just the same.

Any hints appreciated.

Best
Thorsten

//EDIT
Maybe VertexShader code is also interesting, pretty default though

attribute vec4 a_position; attribute vec2 a_texCoord; varying vec2 v_texCoord; varying vec3 v_position; //uniform mat4 u_MVPMatrix; void main() { gl_Position=CC_MVPMatrix * a_position; v_texCoord=a_texCoord; }


Screen Shot 2014-02-18 at 16.03.17.png (58.3 KB)

i have same problem in shader with render texture about this effect.

please write full code about this?