Use ofFbo with shaders

i want to use ofFbo in shader.

ofFbo one,two;
ofEasyCam cam;
ofShader shader;


void setup(){
    int w=ofGetWidth();
    one.allocate(w/4,w/4);
    two.allocate(w/4,w/4);
    one.begin();

	ofPushMatrix(); ofTranslate(w / 8, w / 8);
	ofSphere(22);
	ofPopMatrix();

	one.end();

	shader.begin();
	shader.setUniformTexture("texture",one.getTexture(), 0);
    shader.setUniformMatrix4f("mvpM", cam.getModelViewProjectionMatrix());
    shader.setUniformMatrix4f("tM", tMatrix);
	two.draw(0, 0);
	shader.end();
}

void draw(){
    cam.begin();
	two.draw(0, 0);
	cam.end();
}

Shader contents↓

uniform mat4 mvpM;
uniform mat4 tM;// ofMatrix4x4(0.5,0,0,0,  0, 0.5,0,0,  0,0, 1,0, 0.5, 0.5,0,1);
in vec4 position;
in vec4 texcoord;
out vec4 vTexCoord;

void main() {
    vTexCoord=tM*texcoord;
    gl_Position = mvpM*position;
}

//fragmentShader

uniform float time;
uniform sampler2D  tex;
in vec4 vTexCoord;
out vec4 fragColor;

void main (void) {
    vec4 Col=texture(tex,vTexCoord.xy);
    fragColor=Col;
}

but, this makes the screen black

If drawn with (Fbo)one.↓

I want to make the drawing result of (Fbo)one the same as the drawing result of (Fbo)two.
…Help me

one.begin();
shader.begin();
...
shader.end();
one.end();

two.begin();
one.draw(....);
two.end();

two.draw(...);

i think your code is good.
but i want to use Sampler2d.

your shader is within your startup, so anything drawn there may not be visible.

two is empty. it is never drawn into, but it is drawn into the shader, which does not exist outside of the startup. When you are drawing it within the draw function, within a cam instance, you will be moving/rotating an image. If you don’t translate it deeper into the 3d space in front of the camera, you may not even see it.

I am curious why you are linking the camera within the shader, and then drawing the (empty) two within the camera…

what is your shader supposed to do? It looks somewhat incomplete.

I want to use two Fbo.

I do not know the Matrix for adapting Shader when drawing Fbo.