Texture Blending Questions

I have a case where I want to blend what basically amounts to a screen sized texture onto the main renderer with SDL_BLENDMODE_MOD). Effectively multiplying the background RGB velues by whatever is in the other texture.
I set up the texture by creating a texture and doing “SDL_SetRenderDrawColor(main_renderer, 128, 128, 128, 128);” to it (I set the main_renderer target to this texture for this) and then I additively render other textures to this, this works fine.
I then want to blend this onto the actual main renderer with “SDL_BLENDMODE_MOD” but it doesn’t seem to work, it simply overwrites whatever is already on the main renderer.

Code excerpts below:


// create “lightmap” texture
lightmap = SDL_CreateTexture(main_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, 1280,720);
SDL_SetRenderTarget(main_renderer, lightmap);
SDL_SetRenderDrawColor(main_renderer, 128, 128, 128, 128);
SDL_RenderFillRect(main_renderer, NULL);

// render “lights” additively to the "lightmap"
SDL_SetTextureBlendMode(light, SDL_BLENDMODE_ADD);
dstRect.x = dstRect.y = 100;
dstRect.w = dstRect.h = 512;
SDL_RenderCopy(main_renderer, light, NULL, &dstRect);
SDL_SetRenderTarget(main_renderer, NULL);

// main loop:
// clear renderer

	// render background
	SDL_SetTextureBlendMode(light, SDL_BLENDMODE_NONE);
	SDL_RenderCopy(main_renderer, bgtexture, NULL, NULL);

	// render "lightmap"
	SDL_SetTextureBlendMode(light, SDL_BLENDMODE_MOD);
	SDL_RenderCopy(main_renderer, lightmap, NULL, NULL);

	// present renderer