Jump to content
The Dark Mod Forums

Env Cubemap fix: bugtracker?


Bikerdude

Recommended Posts

Can someone remind me if there is a bug tracker for this for 2.04..?

 

I ask because while playing The Witcher 3 I keep seing loads of fake rooms bhind windows and that reminded me that I would like ti implment that in a WIP I am working on and that we need in the mod in general.

 

@Steve did you say you were working on it?

Link to comment
Share on other sites

From memory there were 3 things we talked about:

  1. fix the output file names and rotations/flip of the images so the envshot pics can be used straight away as a cubemap in TDM.
  2. capture the skybox in the cubemap, not just the main map.
  3. fix it so you don't have to change your screen size to take an envshot

1 is fixed in svn.

2 has an open tracker. It's a big modification so might not get done. But you shouldn;t need it for fake indoor rooms.

3 isn't tracked afaik. It's not a deal-breaker, because you can render any size of cubemap using the command, even though it forces you to use a small game window to do it.

Link to comment
Share on other sites

1 is fixed in svn.

2 has an open tracker. It's a big modification so might not get done. But you shouldn;t need it for fake indoor rooms.

Awesome, gonna make some generic shots for both of the city WIPS Im working on.

 

Where do I place and face the player when taking an ENV shot? and can I be no-clipped at the time..?

Link to comment
Share on other sites

While testing (1) I made some huge cubemaps in my tiny 640x480 screen. I got to see the individual tiles of each face rendered. I did my tests in PD2. The result was stunning, TDM can look so good in a 4800x4800 cubemap :)

 

Yes you can be noclipped. I don't know where to stand to get a room illusion looking right, sorry. Thinking about it makes my head hurt. Someone must know though.

 

This thread would be better in the public forum I reckon, if someone with the right privs stumbles across it :) Envshot discussion and tip-sharing would be good.

Link to comment
Share on other sites

Direction won't matter. Envshot doesn't take that into consideration. It always shoots north, south, east, west, up and down. You can rotate the cubemap in the material shader if need be.

 

The only thing is, I'm not reading anything in this thread that suggests the changes required to render false room interiors with cube maps have taken place. I'll try to explain...

 

Imagine a cube with the faces turned inside out and their respective, north, south, east, west, up, down textures applied. If you were standing inside the cube, at it's center, you'd have a rough approximation of how cube maps currently behave in TDM. Look up, look down, doesn't matter. You're looking at mountains, stars, clouds; things so far off in the distance that knowing where the player is relative to the center of projection isn't important.

 

But if you want to project rooms through windows, you need to be viewing the cube map from outside the cube. The player isn't forever standing in the center of projection. He's walking by it.

Link to comment
Share on other sites

The only thing is, I'm not reading anything in this thread that suggests the changes required to render false room interiors with cube maps have taken place. I'll try to explain...

That makes perfect sense, although I can't imagine what the right way to do it is. I'll do a bit of research in the hope that it's possible and implementable.
Link to comment
Share on other sites

I'm having trouble finding a method by googling, which seems strange. Plenty of articles on adjusting your generated textures coords for correcting parallax in cubemap reflections, but nothing so far on faking room interiors.

 

But this is going to be a texgen thing isn't it? I'm imagining now you'd take the envshot from the middle of the room and then correct the sample coordinates somehow to adjust for the player's current position.

 

Edit: no, not from inside. You'd want to make your cubemap from outside, probably close to the window, so the right parts of tables, chairs etc are on show when the player is close up. Even with the right texgen, I guess there'll always be some error if the player isn't standing in the spot from where it was taken.

Edited by SteveL
Link to comment
Share on other sites

The term for this is "interior mapping". That said, I'm pretty sure you can make this work otherwise the reflection in our cubemap wiki entry would look wrong.

 

http://wiki.thedarkmod.com/index.php?title=Cube_maps

 

The reflection looks just like a room interior no?

 

Now I've gotta dust off my memories of the difference between camera space cubemap and regular cubemaps.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

 

The reflection looks just like a room interior no?

 

Now I've gotta dust off my memories of the difference between camera space cubemap and regular cubemaps.

 

Yes, i don't know what the doubt is about, a fake window IMO is just like a inverse mirror so if you can fake a mirror on TDM with a cube map you can certainly fake a interior but i could be totally wrong.

 

Btw one second search on Google for interior mapping and voila:

 

http://www.proun-game.com/Oogst3D/CODING/InteriorMapping/InteriorMapping.pdf

Link to comment
Share on other sites

The term for this is "interior mapping". That said, I'm pretty sure you can make this work otherwise the reflection in our cubemap wiki entry would look wrong.

 

http://wiki.thedarkmod.com/index.php?title=Cube_maps

 

The reflection looks just like a room interior no?

Thanks for the correct search term :) I was getting 1000s of false positives with every term I made up.

 

The pool reflection isn't a great illusion. You can see in the first demo shot (before the water gets added) that the corner of the room isn't lining up right with the reflection. It works well enough I guess because (1) the player can't get too far away from the spot where the envshot was taken, and (2) the heat haze effect hides minor misalignments.

 

Yes, i don't know what the doubt is about, a fake window IMO is just like a inverse mirror so if you can fake a mirror on TDM with a cube map you can certainly fake a interior but i could be totally wrong.

Mirrors in TDM are not cube maps. The scene gets rendered a second time from a camera behind the mirror, and the mirror surface is painted with that (2d) image.

 

All the interior mapping articles I've seen have been about rendering interiors that'll be seen from a distance. Easier to preserve the illusion that way. We'll just have to try it and see how good a job it can do with an envshot taken from just outside the room.

 

I did try it with a normal cubemap about a year ago. As expected, I couldn't get it to look right even for a distant or high-up window. Cubemaps work by taking into account only the direction the player is looking. As Rich said, if you look up you see stars or ceilings. Down and you see floor. Now imagine standing still in front of a cube map window and looking around so that the window moves round the edge of your screen. What you can see "through the window" will change as your view direction changes, even though your eyes haven't moved. The effect looks bizarre and wrong.

 

So we need corrected texcoords for the cubemap. It's probably best and easiest to do this the modern way in a shader program rather than add to the texgens in the engine.

Link to comment
Share on other sites

Yes you are right, tried this just now on Doom 3 and found that it could work, if you where able to freeze the view, when you are near a "window" with a cube map and just stay still it looks really cool and realistic, but the second you move the illusion is lost, the cube map moves relative to your view and it shouldn't, it also increases in size the far you get from the "window" also something that shouldn't happen. I think this can be fixed by modifying the cube map code so it projects the view relative to the "window" surface normal and stops moving and scaling relative to the player.

 

 

edit: Hum thinking about it, it does need to take the player position into account, if not, when you look to a cube mapped window from the side how would it know that it should show the left or right wall, instead of some other side? It also needs to maintain scale relative to the player, right now it increases in size the far you are from the window but should be the other way around, it should scale up has you get close and down has you get far.

Edited by HMart
Link to comment
Share on other sites

The algorithm in that pdf you posted is tailored to the specific task of creating multiple repeating windows in a regular pattern. Also, it's mostly concerned with how to do it without using a cube map -- not a problem we need to tackle.

 

No doubt we could get some useful info from it nontheless, but before trying to adapt it I'm trying to figure out whether we can fix it with a simple tweak to the standard cubemap method of generating texture coords. Instead of using the player's absolute view direction, can we simply use the direction from the player's eyes to a given pixel on the window?

 

That sounds like it should work, but I'm uneasy about the fact that it doesn't take into account the place where the cubemap was captured.... I need to do a couple of diagrams to work it out.

Link to comment
Share on other sites

Mirrors in TDM are not cube maps. The scene gets rendered a second time from a camera behind the mirror, and the mirror surface is painted with that (2d) image.

 

So you could have a camera set up in an unreachable room somewhere on the map and have that textured onto a surface, like a window? Would that be able to move relative to the player somehow? I assume it would require a lot more horsepower certainly, but that could be quite useful in some instances.

Link to comment
Share on other sites

So you could have a camera set up in an unreachable room somewhere on the map and have that textured onto a surface, like a window? Would that be able to move relative to the player somehow? I assume it would require a lot more horsepower certainly, but that could be quite useful in some instances.

Goldwell and Obsttorte had the idea of using a camera view on windows, though Obsttorte reports that you can only have one remote view active at once. I don't know whether anyone's tried it, though. Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...