Jump to content
The Dark Mod Forums

Cube maps howto?


Bikerdude

Recommended Posts

I have had a look but am having trouble following the wiki article - http://wiki.thedarkmod.com/index.php?title=Cube_maps and the article on the waybackmachine

 

The issue is getting the images in the correct orientation, for example the WBM says the foreward image is basename_pz, but you look at the envshot image and its clearly not the forward facing image.

 

What I am looking to do is place the player directly outside a window and then take an EnvShot, it would be great is if darkmod.exe took envshot in the correct orientation so the mapper dosent have to muck about trying to get them facing the right way, rotate or flip them.

 

There dosent even seem to be any tools out there what will import your images to give me a preview, as I am convinced that TDM isnt taking EnvShots correctly.

Link to comment
Share on other sites

Yeah, I looked into that a few weeks ago, because I noticed when making some new windows that the envshot we use for glass is incorrect--the images don't line up properly. But I couldn't get very far in the wiki about how to properly set them up either.

Link to comment
Share on other sites

I think the complication with that TDM wiki entry might have something to do with how texgen reflect works, since the example is a pseudo-reflective pool of water. In the example image of TDM's output, _pz appears to be the ceiling, which makes sense ('positive z-axis').

 

I recently ended up altering water01 for my w.i.p. to make it look right as a reflection of skybox_darkland_ne. (The 'reflected' moon was opposite the one in the sky in X and Y as well as Z, though if you open water_01_pz.tga and darkland_NE_up.tga in an image editor they don't look flipped relative to each other.) What I had to do was along the lines of the instructions like 'Flip it horizontally and rotate it 90° counter clock wise'.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I'll fix this after I finish with 2.03, if someone wants to open a tracker issue and assign it to me. It can't be too hard. The functionality works -- I used it for that dynamic moonlight skybox last year -- it's just that the images need renaming and possibly flipping and rotating. It's ringing a bell, I think I had a written page at some point of the list of transformations for TDM and Terragen. I probably lost that but I can do it again.

Link to comment
Share on other sites

I'll fix this after I finish with 2.03, if someone wants to open a tracker issue and assign it to me. It can't be too hard. The functionality works -- I used it for that dynamic moonlight skybox last year -- it's just that the images need renaming and possibly flipping and rotating. It's ringing a bell, I think I had a written page at some point of the list of transformations for TDM and Terragen. I probably lost that but I can do it again.

Is it also possible to increase the resolution possible with the cube maps as well? Or is that a whole other ball of wax?

Link to comment
Share on other sites

I'll fix this after I finish with 2.03, if someone wants to open a tracker issue and assign it to me. It can't be too hard.

I will do this.

Is it also possible to increase the resolution possible with the cube maps as well? Or is that a whole other ball of wax?

Well for a laugh I was able to take EnvShots @ 2048*2048, but wasn't able to test what they may have looked like in-game.

Link to comment
Share on other sites

Is it also possible to increase the resolution possible with the cube maps as well? Or is that a whole other ball of wax?

I'd be talking out of my hat if I said I knew it'd be straightforward because I haven't checked it out, but hopefully yes :)

 

@Biker: thanks

Link to comment
Share on other sites

  • 3 weeks later...

What I am looking to do is place the player directly outside a window and then take an EnvShot, it would be great is if darkmod.exe took envshot in the correct orientation so the mapper dosent have to muck about trying to get them facing the right way, rotate or flip them.

 

I've fixed this in svn and committed a new engine so svn users can now use envshot without having to rename, rotate, or flip anything. The generated images can be used immediately. It'll be in 2.04 but for anyone else who wants to use the fix in the meantime, I'll link a version of the 2.03 engine including the envshot fix in this thread as soon as 2.03 is out.

 

You have to have 640x480 game screen resolution to make proper cubemap that lines up (at least in original Doom 3). Any other resolution would result in broken cubemap.

 

Correct, any other screensize will screw it up. I've opened a separate tracker for that because it's caused by a wider issue.

 

Is it also possible to increase the resolution possible with the cube maps as well? Or is that a whole other ball of wax?

 

Yes, it turns out this already worked. You need to be using 640x480 when you take your envshot, but you can make it as big as you like. I generated a 4096x4096 envshot using my tiny 640x480 window, and it was perfect -- beautifully detailed. You specify the size as a 3rd parameter after the image name, e.g:

 

envshot imagename 1024

 

Last note: skybox is not compatible with envshot, so it's good only for indoor scenes.

 

Do people think that that needs fixing? The skybox is controlled by game code not the engine, so enabling skyboxes in envshots would mean moving the facility from the engine to game code. Not a massive job, but I don't know whether it's needed or not.

Link to comment
Share on other sites

 

I've fixed this in svn and committed a new engine so svn users can now use envshot without having to rename, rotate, or flip anything. The generated images can be used immediately. It'll be in 2.04 but for anyone else who wants to use the fix in the meantime, I'll link a version of the 2.03 engine including the envshot fix in this thread as soon as 2.03 is out.

 

 

Correct, any other screensize will screw it up. I've opened a separate tracker for that because it's caused by a wider issue.

 

 

Yes, it turns out this already worked. You need to be using 640x480 when you take your envshot, but you can make it as big as you like. I generated a 4096x4096 envshot using my tiny 640x480 window, and it was perfect -- beautifully detailed. You specify the size as a 3rd parameter after the image name, e.g:

 

envshot imagename 1024

 

Last note: skybox is not compatible with envshot, so it's good only for indoor scenes.

 

Do people think that that needs fixing? The skybox is controlled by game code not the engine, so enabling skyboxes in envshots would mean moving the facility from the engine to game code. Not a massive job, but I don't know whether it's needed or not.

 

Well damn that's quite interesting.. I should give that a try next time I need a cube map.

 

In terms of the skybox thing that would be very handy to have it working in the envshots because when I did the cubemap for the accountant 1 it was a nightmare to try and photoshop the sky into the shot so that it fit across all images properly.

 

After that it sort of turned me off using them because I usually want to place them inside reflecting the outside world (looks great through a tinted window and doesn't kill the fps)

Link to comment
Share on other sites

 

In terms of the skybox thing that would be very handy to have it working in the envshots because when I did the cubemap for the accountant 1 it was a nightmare to try and photoshop the sky into the shot so that it fit across all images properly.

 

After that it sort of turned me off using them because I usually want to place them inside reflecting the outside world (looks great through a tinted window and doesn't kill the fps)

 

Ok, I'll see what I can do. New tracker for skybox in envshots #4085

Link to comment
Share on other sites

Do people think that that needs fixing? The skybox is controlled by game code not the engine, so enabling skyboxes in envshots would mean moving the facility from the engine to game code. Not a massive job, but I don't know whether it's needed or not.

Yes please, as several FM's would have benefited from being able to have 'fake outside and inside' textures for simulating a transparent window without the perf penalty.

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...