Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render to texture #89

Closed
wants to merge 1 commit into from
Closed

Render to texture #89

wants to merge 1 commit into from

Conversation

fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Dec 24, 2024

Implement an easy way of using render to Texture

@rickgaiser
Copy link
Member

I would like to see a more generic approach of buffers in vram. Each buffer has:

  • Width
  • Height
  • PSM
  • Vram
    Just like GSTEXTURE.

Each buffer can be:

  • Framebuffer (2k aligned)
  • Z buffer (2k aligned)
  • Texture buffer (64 words aligned)
  • CLUT buffer (64 words aligned)

We should be able to use all buffers for all puposes, assuming a 2k alignment during buffer creation:

GSTEXTURE *tex, *disp;

// Display this buffer
gsKit_setDisplayBuffer(gsGlobal, disp);

// Simple rendering
gsKit_setRenderBuffer(gsGlobal, disp);          // render to display buffer
gsKit_prim_sprite_texture(gsGlobal, tex, ...);  // render texture to display

// Render to texture
gsKit_setRenderBuffer(tex);                     // render to texture
gsKit_prim_sprite_texture(gsGlobal, disp, ...); // render from display 'texture' to texture

We can add 2 GSTEXTURE objects in gsGlobal that represent the display/render buffers as GSTEXTURE objects, making it instantly possible to use them as textures.

Then as a second step we can start using GSTEXTURE object for render/display/texture functions, just like the functions you have created. But instead of two gsKit_renderToScreen and gsKit_renderToTexture we can then have 1 gsKit_setRenderBuffer.

@fjtrujy
Copy link
Member Author

fjtrujy commented Dec 24, 2024

Closing this PR as I think current gskit is not in a state where that functionality can be easily implemented, so I will put the functions in the repos where I'm using it

@fjtrujy fjtrujy closed this Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants