1
Graphics / Re: Render Texture with a View
« on: July 31, 2020, 09:19:15 am »
I did not post code originally cause I am working with Box2D as a physics engine, and even the code that isn't part of that is pretty much a whole spaghetti
What I m doing is first constructing a convex shape, and on its points i am drawing Quads.
First i draw on the screen a completely brown RenderTexture (that works perfectly fine) then i draw the convex shape onto another RenderTexture, and then everything with the Quads i draw on the RenderWindow.
It is supposed to look like a cave.
My problem is, as it is on the image (i hope i attached it perfectly), that after i move the RenderTextures stay in place. Moving the sprites with the view works for the brown background, but not for the darker background of the cave (image 2 and 3).
What I think my problem is:
The RenderTexture does not move with the view and so the relative position of the convex shape is allways the same
I may missunderstand how RT-s work, but what I think my goal is and how it is supposed to work, that it fills the view, and moves with it.
I hope I could explain it, english is not my first language, sorry if I am not really clear.
What I m doing is first constructing a convex shape, and on its points i am drawing Quads.
First i draw on the screen a completely brown RenderTexture (that works perfectly fine) then i draw the convex shape onto another RenderTexture, and then everything with the Quads i draw on the RenderWindow.
It is supposed to look like a cave.
My problem is, as it is on the image (i hope i attached it perfectly), that after i move the RenderTextures stay in place. Moving the sprites with the view works for the brown background, but not for the darker background of the cave (image 2 and 3).
What I think my problem is:
The RenderTexture does not move with the view and so the relative position of the convex shape is allways the same
I may missunderstand how RT-s work, but what I think my goal is and how it is supposed to work, that it fills the view, and moves with it.
I hope I could explain it, english is not my first language, sorry if I am not really clear.