Home Technical Talk

how to get behind things in prerendered background

polycounter lvl 15
Offline / Send Message
arrangemonk polycounter lvl 15
Hi,
i was working on a project using fairly large prerendered partial cubemaps as
background (like in ukarena of time)
its an xnaXNA 4 application, and you can look at it, if youre interested
looksgoodhere.jpg
(image for those who fear using downloaded exes)


the problem im having is i dont really know how to hide the character behind the objects.
suxhere.jpg
(this particular position wouldnt happen with collition detection, but i didnt implement that yet, but one could still walk behind that container thingy)


i figured i could use a depth cubemap and combine it with the realtime rendered stuff first (lixe max(cubemap,renderedstuff) and substract the negative of the rendered stuff and crank up the contrast or something like that (this woudl be cool for *realtime lighting* but would require normal and specular too , and then a scene would use up tons of diskspace and wouldt really render quicker than using the geometry in realtime)

or i could use some proxy geometry with the cubemap as texture (from viewpoint as center)

or something completely differnt

does someone of you know a completely differend or better method?

thanks a lot

Replies

  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    It could only be a mask stored in your cubemap alpha, no ? Why a zbuffer ?
    From a constant point of view, occluding objects will stand still.
    With geometry you wont have a nice transparency behind that blue lighted cylinder laser thingy, while you could easily render it in a mask.

    edit: ah got it, for the pipe indeed, how to know if your behind or in front.

    oh btw with a worldspace normal cubemap, wouldn't you be able to add some dynamic lighting ?
  • arrangemonk
    Options
    Offline / Send Message
    arrangemonk polycounter lvl 15
    yes, world space normal cubemap could add dynamic lighting, but whats the point in prerendering then?

    i could reuse the cubemap for reflections (i would need a separate smaller version for that, since a 12k * 2k cubemap is a huge beast about 8-12mb)

    edit:
    i made a proxy mesh, drawn it with cubemap applied (camera as center, it was a hell to figure out how to draw it like that) and it worked
    now i have to figure out transparency
    works.jpg

    next: alpha
    then: collition detection

    edit2: i updated the executable
Sign In or Register to comment.