Sign in to follow this  
  • entries
    235
  • comments
    509
  • views
    171997

Lighting & Widescreen

Sign in to follow this  
SimmerD

70 views

I spent yesterday making various fixes, including improving the gun UI display. My initial cut didn't light the guns, but just used their diffuse texture, which in some cases can make them look very different than in-game, ignoring gloss & emissive.

I went ahead and added some simple diffuse & specular lighting, took the metallic color into account, and added emissive as well.

I spent several hours tracking down a maddening bug where the Higgs pistol's tex coords were completely screwed. Turns out the higgs pistol T coords were negative, but usually the texture sampler was in wrap mode, so it worked anyway. I fixed it with Unwrap3D by moving the tex coords in range so clamp mode would work properly.

I also mananged to break mip-mapping when adding the emissive color support, so I had to fix that. Basically, I wasn't sure if the diffuse alpha in the full-screen alpha texture was valid ( which is now used for the emissive mask ), so I used the passed in tex coords for entities rather than the screen-space projected texcoords. Of course, the code wasn't all changed, so this caused some issues. I ended up ensuring that the diffuse alpha was properly updated, and low and behold, I had mip-mapping working again, and emissive, too.

I also found & fixed a problem with non-shadowed lights not casting any light on entities. The ship level showed this most obviously, because I turned off shadows for all on-board lights. It fits the level better and runs faster, and this way your player shadow won't project onto a screen or panel in an obstructive manner.

This morning my main task was to make the user interface elements more resolution independent. The UI was set up for 1024 x 768, so I have simply kept that, but added x & y scale factors derived from the actual resolution to place the guns, health bars and entity status.

In the process, I tested screen resolution changes, and found and fixed a cegui bug that caused a crash inside of d3d9. Does anyone know how to submit a fix for cegui?

The game is not quite wide-screen friendly. There are separate values in the render.txt file for field_of_view and aspect ratio, but no in-game way to tweak them.

I also ran into another mysterious debug mode d3d issue. My game has never rendered properly under debug d3d mode, although there are no warnings given as to why. I have also stepped through the game in perfhud and seen no reason why. I do an unusual but legal set of render target switches, and it seems to throw d3d in a loop in such a way that dest alpha stops being updated ( making all lighting in my game go away ), and now a new problem surfaces when I recreate the device that makes the main viewport pure white.

Later this afternoon I will get more of the user interface displayed, like the charater's element inventory, and an indicator when you hit one of the number keys to select a weapon slot.

Here is a shot of the fixed entity lighting on the guns :


Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now