how multitexturing works in 3.0?

I have RenderTexture where I render all the level sprites. And then use post processing shader to add fog of war and some light effects, but in cocos2dx 3.0 version this is not working anymore. It just generate blank. :smiley:

I tested to toggle off using shader with the RenderTexture and then it did draw all the level sprites, so the RenderTexture seems to work, but propaply multitexturing doesn’t work.

What is the proper way of doing multitexturing in 3.0?

My current code is like this:

void MapSceneRenderTexture::visit(Renderer *renderer, const kmMat4 &parentTransform, bool parentTransformUpdated)
{
 	GL::bindTexture2DN(1, texFogOfWar->getName());
 	GL::bindTexture2DN(2, texLights->getName());
 	GL::bindTexture2DN(3, texBgTile->getName());

	BaseClass::visit(renderer, parentTransform, parentTransformUpdated);

	GL::bindTexture2DN(1, NULL);
	GL::bindTexture2DN(2, NULL);
	GL::bindTexture2DN(3, NULL);
}

I tried using CustomCommand before and after the visit to set the textures. It did manage to render something now, but everything was upside down, ground was still missing and colors where kinda random. :stuck_out_tongue: So yeah it didn’t work too well but atleast shows that the shader and the RenderTexture is doing something.

In cocos2dx 2.2 this worked fine. Whats the proper way to bind texture to other texture units when using RenderTexture?

Seems the multitexturing works okey now after adding also GroupCommand.

The random colors seemed to cause just because touches went trough to my not visible debug menu shader setting sliders. :stuck_out_tongue:

But yeah there still some problems tough, but not multitexturing related. For some reason everything is still upside down (flipped horizontally). Maybe something different with shader texture coordinates in 3.0?

And I have problem with the ground texture being random size and in random position. The ground is another rendertexture also, that is more bigger than the screen. The rendertexture with level sprites seems to work ok (maybe cos its same size as the screen), but the ground rendertexture seems to error. Seeing on forum it seems others have had problems with non screen size render textures also.