Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Screen to Texture

  1. #1
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Screen to Texture

    Hi,

    I render my wolrd to the screen. Now I want my wolrd to be renderd to a texture FROM the screen.

    ps. I can render the world to a texture and render that texture to the screen, but thats not what I want...
    NecroSOFT - End of line -

  2. #2

    Screen to Texture

    Is this in OpenGL, SDL, DirectX, or what? In SDL this is easily done with SDL_SaveBMP(Surface, FileName) witch will return a 0 if it fails and >0 if it succeeds (if I remember properly). Same is true for OpenGL and DirectX, I just don't know the calls by heart

  3. #3
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Screen to Texture

    I'm using DirectX.

    It's not that I need to save it as a bitmap, I just want my world to be on a texture so I can add some calculations on it and render it back to the screen.
    NecroSOFT - End of line -

  4. #4

    Screen to Texture

    Why can't you render the scene to the texture with the same dimensions as screen?

  5. #5

    Screen to Texture

    Edit: sorry misread your post
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  6. #6
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Screen to Texture

    Quote Originally Posted by grudzio
    Why can't you render the scene to the texture with the same dimensions as screen?
    I already do that. But somhow it gives some wierd results.

    See movie:
    http://necrodome.homeftp.net/zooi/ScagBug.wmv
    http://necrodome.homeftp.net/zooi/ScagBug2.wmv

    If I render it directly to the screen, everything is just normal without the black stuff
    NecroSOFT - End of line -

  7. #7

    Screen to Texture

    Have you tried to render to texture and render back to screen without any postproccessing? In my opinion there can be two possibilities - wrong texture format (i. e. pixel format) or something is wrong during postproccessing.

    If it is not the case then I can't help you (I am OpenGL person). Have you looked at DirectX documentation? Maybe there you find something.

  8. #8

    Screen to Texture

    do you do something weird to the depth buffer? set alpha or something?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  9. #9

    Screen to Texture

    Hi!

    Have you cleared both color and depth buffer before rendering to texture? It is not always sufficient to render background, you need to clear color buffer manually.

    Also, you will probably need to clear everything once when you are ready to render texture to screen.
    blog: http://alexionne.blogspot.com/

  10. #10
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Screen to Texture

    I clear it when rendering to the texture and I clear everything when rendering the texture to the screen...

    The blend mode used for tha particles is Invert Alpha or something.
    When I use another blendmode everything is just normal. So it has nothing to do with the z-buffer....

    Altrough it could be used to make some funny effects
    NecroSOFT - End of line -

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •