chaosfire / vdrift-ogre

Automatically exported from code.google.com/p/vdrift-ogre
0 stars 0 forks source link

Graphics issues (black terrain, square shadow, ward lighting) #155

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Ok so I tried the 1.6 stable version (from sourceforge).
There are lots of issues with the graphics part of the game, which sometimes 
are a burden on the gameplay.

My specs:
xUbuntu 12.04 LTS 64 bit, with Catalyst 12.4
Intel Core 2 Duo e6750 @ 2.66 GHz
4GB ddr2 800MHz RAM
AMD Radeon HD 5670 1GB GDDR3

So starting with the resolution: works fine, can set whatever I want to, 
fullscreen also works, great.

Anti-aliasing: ummm... doesn't work... tried all of the options...

effects:
They seem to work, except for the ones that I can't even enable, but they're 
very performance demanding... These are all effects that could be done in like 
3-5ms rendering time. and you do it in like 5-10ms, so I get roughly 20 FPS on 
less demanding maps like s6-pipecrazy. So they're good that they're there, but 
I turned them off because I couldn't drive like that.
Film grain doesn't work. It makes the whole screen dark.

Graphics settings.
I set textures to anisotropic, 4x no performance hit, nice.
I used big for the textures, normal for the terrain and high for the shaders.
setting them parallax and ultra doesn't really add visual detail but no 
performance hit either. This might be because you're only changing shader 
precision perhaps and you add a few instructions to fake the parallax effect. 
You don't have parallax occlusion mapping, do you?
I didn't really change the detail section, because it seemed fine.
I used 1.0 everywhere at vegetation and checked use imposters.
shadows. the basic shadow settings are crap. changing them to soft, 1024, 3, 3, 
3 kind of solves the problem, but the implementation or the algorithm is still 
crap. Are you using cascaded shadow mapping? To add the filtering should be 
better, variable penumbra is missing completely. I could either set bumpy 
shadows, or soft shadows with constant blurring. You seem to be having some 
depth issues as well, because in the distance shadows are just pure crap. 
reflections. They look lice, no performance hit even when using full 
reflections, and its nice that you added frame skipping.
water. it looks kind of far-cry-ish, which is nice, but sometimes it is just 
full blue, so it doesn't work. Turning on reflections isn't a big performance 
hit, but refractions IS. It's nice that it can be changed, and 256 seems to be 
enough.
particles. I haven't really tweaked this, but they aren't such a performance 
hit, so I left both options turned on. The sparks look nice on the car.

Ok so that was about the graphics. There is one more bug here, on tropical maps 
the terrain has a black overlay in the not too far distance.

gameplay:
there is a bug when you make the car turn upside down with "w", and if you hit 
the gas the speed will increase and the car will lean forward even though it 
doesn't move.
The car feels like as if it is going on ice all the time. I used both traction 
control and abs, since I'm not a very good driver.

All in all the game seems promising, but need serious fixes. To add I liked it, 
so keep the good work up!

Original issue reported on code.google.com by neke...@msn.com on 8 May 2012 at 6:55

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 9 May 2012 at 5:31

GoogleCodeExporter commented 8 years ago
About effects: Filmgrain on OpenGL is already fixed in dev version. HDR and 
Bloom will see massive quality improvements in the next version (already in 
git).

The gameplay bug about car leaning is directly related to Issue 86

Original comment by tapiovie...@gmail.com on 12 May 2012 at 12:19

GoogleCodeExporter commented 8 years ago
Thanks for feedback.
This is probably 1st user feedback (longer than 1 line) we have here.

I'm quite busy (but can't handle shadows) so just few comments from me:
Few options were in development.
As for shadows, be happy that you didn't try the game in 1.0 ver, there weren't 
any depth shadows :P. So I wouldn't complaing about no variable penumbra, but 
are you a programmer ? seems like you know about shadows, maybe you could fix 
them.
Parallax is there, just on terrain, but it's difficult to see since a while.
Black overlay ? I don't know of it, pls upload a shot.
Serious fixes were needed 1.5 year ago. Now they aren't so serious IMO. And 
there aren't that many serious people here that could fix them :)

Original comment by Cry...@gmail.com on 12 May 2012 at 1:26

GoogleCodeExporter commented 8 years ago
"but are you a programmer ? seems like you know about shadows, maybe you could 
fix them."
yes, kind of. I'm becoming one. I've implemented a lot of techniques, but so 
far I didn't have time for implementing shadows in my own engine.
As for the fixing:
The key thing for the shadows is making them deferred. Then you can use 
cascading. You'll also need to implement a proper filtering technique. You can 
find a similar shadowing solution in GPU Pro, and you can find MJP's 
implementation here:
https://skydrive.live.com/?cid=538e432ea49f5bde&id=538E432EA49F5BDE!125
"it's difficult to see since a while"
well, it's meant to be seen. If it cannot be seen, then it shouldn't be there. 
Maybe you should do some per-pixel specular highlights, also since you're using 
it for rendering terrains you also need a lighting technique that's not Phong 
(or Blinn-Phong). You should rather use the anisotropic Ward approach.
http://content.gpwiki.org/index.php/D3DBook:%28Lighting%29_Ward
It costs a little bit more, but you can simulate rough surfaces (terrain), and 
metallic surfaces (cars) better. Since you only have one global directional 
light (i.e. sun) you can pretty much afford it.
I attached a screenshot.

Original comment by neke...@msn.com on 13 May 2012 at 6:45

GoogleCodeExporter commented 8 years ago
here's a picture about the shadows.

Original comment by neke...@msn.com on 13 May 2012 at 7:06

GoogleCodeExporter commented 8 years ago
The black terrain looks like an fglrx driver issue (we all know ATI on linux 
isn't great). About the shadows, please don't use "soft". They are unfinished 
and don't have self-shadowing as you can see, so make sure to use "depth". 

We are already using split shadow maps (PSSM actually). Apparently there's a 
bug with it in your screenshot that i've no idea about; they work fine here.
For proper filtering we can use VSM (no need for deferred shadowmaps). It was 
started but never finished (shadowtype "soft")

Original comment by scrawl...@gmail.com on 13 May 2012 at 8:31

GoogleCodeExporter commented 8 years ago
And thanks for the suggestion with WardIso shading, I think it's a good idea.
We don't have time to implement all of this, but if you know a little 
C++/shaders, it would be great if you started hacking and submit your patches 
;) (the source is very easy to compile on linux)

Original comment by scrawl...@gmail.com on 13 May 2012 at 8:43

GoogleCodeExporter commented 8 years ago
ok, so I changed to depth, but it's still the same...
Well, it's true that you'd only need deferring if multiple lights were in the 
scene, but the rendering quality in the GPU Pro article is way better than 
this. This may be due to the anisotropic gaussian blur filter that is applied, 
which also enables the technique to have variable penumbra. And in that 
technique the shadow generation pass isn't deferred but rather the filtering 
pass. It also uses some tricks to get cheap penumbra. 
Can you please attach a screenshot about the shadows from the same location? 
(f3-osso, right after the start turn right.)
Well, I can look into it :) I planned to implement Ward anyways...

Original comment by neke...@msn.com on 13 May 2012 at 2:00

GoogleCodeExporter commented 8 years ago
This is how it looks here with 2k shadowmaps: 
http://scrawl.bplaced.net/temp/shadows1.jpg

Original comment by scrawl...@gmail.com on 13 May 2012 at 2:33

GoogleCodeExporter commented 8 years ago
hmm... that seems kind of ok. Does it flicker?

anyways I got through most of the building, but when I start stuntrally (now 
the git version)
I get this:
Loading library /usr/local/lib/OGRE/Plugin_CgProgramManager
An exception has occured: OGRE EXCEPTION(7:InternalErrorException): Could not 
load dynamic library /usr/local/lib/OGRE/Plugin_CgProgramManager.  System 
Error: /usr/local/lib/OGRE/Plugin_CgProgramManager.so: cannot open shared 
object file: No such file or directory in DynLib::load at 
/home/yours3lf/Desktop/ogre-source/ogre/OgreMain/src/OgreDynLib.cpp (line 91)

I suppose ogre needs some plugins... Where can I get them? (and how)

Original comment by neke...@msn.com on 13 May 2012 at 4:42

GoogleCodeExporter commented 8 years ago
where did you get ogre from? the dll(Plugin_CgProgramManager.dll) should be 
next to the lib you linked against

Original comment by a.isma...@gmail.com on 13 May 2012 at 6:54

GoogleCodeExporter commented 8 years ago
from mercurial, it didn't even include OIS, I had to install that from synaptic.

Original comment by neke...@msn.com on 13 May 2012 at 7:31

GoogleCodeExporter commented 8 years ago
ok solved it, I just needed to install cg toolkit, and recompile the whole 
ogre, and stuntrally. Now it runs, but when I get into the game it doesn't 
react to any buttons.
I can't even press ESC and exit. When I close the window with the mouse it 
segfaults.
One more question: where are the currently used lighting shaders?

Original comment by neke...@msn.com on 13 May 2012 at 8:50

GoogleCodeExporter commented 8 years ago
Cg shaders are generated by cpp code. Thanks to scrawl's material generator 
(see source\ogre\common\MaterialGen\Material*.cpp and *.h files).

Original comment by Cry...@gmail.com on 13 May 2012 at 9:18

GoogleCodeExporter commented 8 years ago
It's a monster at first (complicated) but is an awesome thing. The materials 
are then defined using simple and powerful *.matdef files.

Original comment by Cry...@gmail.com on 13 May 2012 at 9:21

GoogleCodeExporter commented 8 years ago
Attach log.txt, something bad happended to input or ois ?

Btw. Feel free to join on irc, #stuntrally on freenode, would be faster to chat 
if you catch someone there, anyway I'm off to bed.

Original comment by Cry...@gmail.com on 13 May 2012 at 9:26

GoogleCodeExporter commented 8 years ago
here it is, it took a while to find it :)

Original comment by neke...@msn.com on 14 May 2012 at 9:57

Attachments:

GoogleCodeExporter commented 8 years ago
ok, so I implemented anisotropic Ward lighting with the help of the guys from 
IRC (scrawl and aave). I created a local branch called ward_lighting, and 
committed the changes. I only need to make sure that the anisotropic roughness 
value gets passed to the shaders.

Original comment by neke...@msn.com on 14 May 2012 at 4:54

GoogleCodeExporter commented 8 years ago
can you push it so we can see the changes on the web?
https://github.com/stuntrally/stuntrally/branches

Original comment by a.isma...@gmail.com on 14 May 2012 at 5:08

GoogleCodeExporter commented 8 years ago
yesterday I switched from anisotropic Ward to isotropic, because the 
anisotropic version (coupled with bump mapping) requires tangents as well, and 
that cannot be retrieved with only per-pixel normals at hand. But the isotropic 
version works well, 
I currently set it to use the shininess value that comes from the per-pixel 
specular exponent. However that per-pixel value needs to be adjusted since 
roughness != shininess. I made some experiments with per-object constant 
shininess values, here are the results (0.1, 0.2, 0.4, 0.6, 0.8):
http://s15.postimage.org/3tcoma3kr/ward01.png
http://s15.postimage.org/f6z7xhe3f/ward02.png
http://s17.postimage.org/8tf6rdi4f/ward04.png
http://s13.postimage.org/vorq511s7/ward06.png
http://s14.postimage.org/u6octvzw1/ward08.png

the current blinn-phong implementation (per-pixel):
http://s14.postimage.org/69fvmffxt/pong.png

Note that this method can be made faster by creating a lookup texture (R32F). 
That way it would only require 33 instructions (blinn-phong requires 23), as 
opposed to the current 44 instructions (the anisotropic is 48)

Original comment by neke...@msn.com on 15 May 2012 at 5:34

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 11 Jun 2012 at 4:14

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 17 Jun 2012 at 8:37

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 17 Jun 2012 at 9:21

GoogleCodeExporter commented 8 years ago
To fix black overlay, we need png not dds for all terrain textures, anyone 
could fix it by resaving in Gimp (it's tedious to do it for each textures).

Square shadows can't be fixed, this happens with camera dir close to sun dir.

As for rest and ward lighting - it's been over 6 months, closing.

Original comment by Cry...@gmail.com on 23 Dec 2012 at 10:58