Port of my city renderer

liinor said:
zephyr2 said:
Not sure if you are aware of this, but the program still reads mouse input when it is not the active window and responds to it.

I noticed same on two days ago but I didn't make alert of that yet because it wasn't combined to Project Doll House yet.

Right, I just figured I'd mention it in case it was in any way related to the crashing while minimized. It most likely isn't but maybe it's worth it to change it.
 
zephyr2 said:
liinor said:
zephyr2 said:
Not sure if you are aware of this, but the program still reads mouse input when it is not the active window and responds to it.

I noticed same on two days ago but I didn't make alert of that yet because it wasn't combined to Project Doll House yet.

Right, I just figured I'd mention it in case it was in any way related to the crashing while minimized. It most likely isn't but maybe it's worth it to change it.

I found same from Afr0's Project Doll house Bug fixes client so I didn't tell this bug either. :D


Re: Kon Tiki, bugfix(es)

Posted by liinor » Tue Jan 14, 2014 1:19 pm
Bug reports
- If you minimize and then enlarge project doll house screen it will crash.
- There is also that text bug in login screen which makes game crash (if you're going under text string limit, under 0).
- If you click TSO credits button music stops. :(
- If you login once with wrong password it will freeze game (because wont let you login with real pass).
 
zephyr2 said:
liinor said:
zephyr2 said:
Not sure if you are aware of this, but the program still reads mouse input when it is not the active window and responds to it.

I noticed same on two days ago but I didn't make alert of that yet because it wasn't combined to Project Doll House yet.

Right, I just figured I'd mention it in case it was in any way related to the crashing while minimized. It most likely isn't but maybe it's worth it to change it.
It's definitely not related to the crash. That happens whenever GFX loaded resources are called for after gfx device reset (minimize)... I'll need to find out some way to store the textures as something reloadable W/O file access, but I'm not sure how since XNA formats are still a mystery.

You'll actually notice that on the full Project Dollhouse client you also get this effect (input when not in focus). We're not checking if the program isn't focused when dealing with mouse inputs, so they trigger all the time. I'm not sure what handling is used for mouse events in Project Dollhouse, but knowing that is crucial to implementing the CityRenderer in it as the UI will need to block mouse inputs, so that people won't select tiles/drag around when they're clicking on the UI elements.
 
In the UI engine I built for PD there is a full depth test system for mouse interactions so when we integrate your example code we can hook it up to that :).

RE the non focused mouse stuff, this is just default XNA behaviour that we never got around to working around heh. We also haven't put a huge amount of effort into GPU reset handling too such is the way when you want to keep moving onto the next exciting bit. It will all get cleaned up eventually.
 
New update: Test with shadow mapping.

Shadow%20Map.png


I'm not going to release this yet as there are still a few optimisations I can make/attempt. It looks mega cool but doesn't look great in near view due to the shadow map size. It's also actually slower than 60fps on my NVIDIA GeForce 635M, which probably isn't good news for anyone with a normal computer.

I'll attempt the optimisations and see how much better it gets, but either way this feature will be toggleable so anyone with a graphics card that is prone to melting can disable it.

Rendering every frame on its own can be pretty tough too, so I might also add a mode where it just draws the city once every 10 seconds (to keep up with city lighting) in far view and only draws it when moving in close view.
 
https://dl.dropboxusercontent.com/u/122 ... erShad.zip

Right now works great on NVIDIA, on Intel though it seems to be doing shadowing per triangle? Great work on your shader cores guys.

I'm currently dynamically altering the projection region of the shadow map to squeeze the most out of it for near view. It's not doing it as well as I could right now, though, but this looks fine.

Right now the shadow map is set to 2048x2048, but again this is adjustable via a public attribute. You can also turn shadows off with the public attribute, as promised, so these city settings could be added in the graphics options.
 
Problem: I have Intel. Not good. Why not make the shadow map bigger or smaller to see if it adjusts, that might do it. Nice work though. Is it dynamic as of position of the sun or not?
 
xezno said:
Problem: I have Intel. Not good. Why not make the shadow map bigger or smaller to see if it adjusts, that might do it. Nice work though. Is it dynamic as of position of the sun or not?
Yes, the position of the sun is dynamic and in sync with the lighting cycle. The problem isn't the size of the shadow map, it's POSITION1 failing to interpolate on the intel card, thus it thinks the whole triangle is at the same depth.
 
Lol I will try it. Nice work for definite.

EDIT: KDE just crashed on me...?
EDIT2: Terminal too? What the heck is going on today?
EDIT3: Meh fixed itself.

[Part of EDIT3
Unhandled Exception:
System.ArgumentException: The device name is not valid. Device names are in the form \\.\\DEVICE1
Parameter name: screenDeviceName
at Microsoft.Xna.Framework.WindowsGameWindow.ScreenFromDeviceName (System.String screenDeviceName) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.WindowsGameForm.ResizeWindow (System.String screenDeviceName, Int32 clientWidth, Int32 clientHeight, Boolean center) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.WindowsGameForm.EndScreenDeviceChange (System.String screenDeviceName, Int32 clientWidth, Int32 clientHeight) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Microsoft.Xna.Framework.WindowsGameForm:EndScreenDeviceChange (string,int,int)
at Microsoft.Xna.Framework.WindowsGameWindow.EndScreenDeviceChange (System.String screenDeviceName, Int32 clientWidth, Int32 clientHeight) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.ChangeDevice (Boolean forceCreate) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice () [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Game.Run () [0x00000] in <filename unknown>:0
at CityRenderer.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: The device name is not valid. Device names are in the form \\.\\DEVICE1
Parameter name: screenDeviceName
at Microsoft.Xna.Framework.WindowsGameWindow.ScreenFromDeviceName (System.String screenDeviceName) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.WindowsGameForm.ResizeWindow (System.String screenDeviceName, Int32 clientWidth, Int32 clientHeight, Boolean center) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.WindowsGameForm.EndScreenDeviceChange (System.String screenDeviceName, Int32 clientWidth, Int32 clientHeight) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Microsoft.Xna.Framework.WindowsGameForm:EndScreenDeviceChange (string,int,int)
at Microsoft.Xna.Framework.WindowsGameWindow.EndScreenDeviceChange (System.String screenDeviceName, Int32 clientWidth, Int32 clientHeight) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.ChangeDevice (Boolean forceCreate) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice () [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Game.Run () [0x00000] in <filename unknown>:0
at CityRenderer.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
]
 
...What?
I don't have control over how XNA hooks into the graphics device, so I can't fix that.

There seems to be a problem loading the CityRenderer on my Desktop PC... Not sure if I'm missing a DirectX Redistribution, but I do have XNA 3.1 and .NET
 
http://www.youtube.com/watch?v=cyVKs5MC17I

Here's a video of it in action, if you for some reason can't use the version with shadows. Youtube seems to have completely butchered the framerate and colours, but other than that it demonstrates all functionality across multiple cities.
 
RHY3756547 said:
http://www.youtube.com/watch?v=cyVKs5MC17I

Here's a video of it in action, if you for some reason can't use the version with shadows. Youtube seems to have completely butchered the framerate and colours, but other than that it demonstrates all functionality across multiple cities.
I can't use anything XNA by the looks of things O.O
 
Afr0 said:
I just awarded you with a special badge :)
Heh, I wouldn't put this around the same level as anything John Carmack has achieved, but I'll take the complement. :lol:

As for the crash on my PC I mentioned, I accidentally included city_07 instead of city_13. It worked perfectly when I copied the right folder, so hopefully there shouldn't be any compatibility issues with other PCs. (AMD? I don't have any AMD cards to test with)
 
RHY3756547 said:
As for the crash on my PC I mentioned, I accidentally included city_07 instead of city_13. It worked perfectly when I copied the right folder, so hopefully there shouldn't be any compatibility issues with other PCs. (AMD? I don't have any AMD cards to test with)

Have you linked the new files yet? I have an AMD card and can test it when I get home later on if you want to be sure.
 
Back
Top