fullscreen mirror

Blitz3D Forums/Blitz3D Programming/fullscreen mirror

Pax(Posted 2008) [#1]
Hello, I need to create a mirror (fullscreen). So far I have tried rendering to texture (using renderworld + copyrect) and using copypixel fast. Problem is using the texture approach, there are some extra jaggies appearing now and then, as well as the texture size seems to be limited by my card (7600 go). Copypixelfast wasn't that fast to do real time.

Any suggestions are more than welcome, regards.


big10p(Posted 2008) [#2]
Exaplain more what you mean by a 'fullscreen mirror'. What exactly are you trying to mirror? You know about the built-in mirrors of B3D (CreateMirror), right?


Pax(Posted 2008) [#3]
Hi big10p, thanks for posting, sorry for being so vague. What I want to do is flip horizontally everything the camera sees, and display it full screen , not on the floor, but in front of the screen. I was trying to parent a sprite / cube in front of the camera, and that's why I used the copypixelfast / copyrect without much luck. I did knew about the createmirror, but it seems to work at "ground" level only.


Stevie G(Posted 2008) [#4]
If you want the texture on the cube to be flipped across the x axis then just change the vertex uv's coords of the entity which your texturing.

On a cube for example:

cube = createcube()
FlipU( cube )

function FlipU( entity )

  s = getsurface( entity , 1 )
  for v = 0 to countvertices(s)-1
    if vertexu( s, v ) = 1 - vertexu( s, v )
  next

end function


[EDIT] Thinking about it - this is probably not what your after. I'd check out the full screen blur routines in the archives - they will help you in adjusting the uv's ( although the U they'll still need flipped ) and scaling the cube to fit the screen correctly.


Pax(Posted 2008) [#5]
Hello Stevie, thanks for the uv flip idea (at this stage I didn't thought about that one). It seems this might be sorted out, will check the full screen routines. Regards.


Knight #51(Posted 2008) [#6]
How about you "grab" all of the entities on the screen and invert their vertices?

[EDIT] But only their X coords ;)


SLotman(Posted 2008) [#7]
cant you just rotate the camera?


Kryzon(Posted 2008) [#8]
Nice suggestion! rotating the camera 180 on Roll should do it!


Stevie G(Posted 2008) [#9]
No it won't - the image will simply be upside down - not reflected on the x axis.


GitTech(Posted 2008) [#10]
Maybe ScaleEntity camera,-1,1,1?


Kryzon(Posted 2008) [#11]
Stevie G - You're right, I just thought he wanted mirrored vertically.

So GitTech got it, I just tested it now, scaleing the camera in -1,1,1 inverts the image horizontally (actually, since you can put any value there, it gives all sorts of different visual distortions but while keeping the viewport full! it's an amazing feature).