World Simulator: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
Secondary tasks: | Secondary tasks: | ||
* Evaluate how much code must be ported to C# so that rendering and driving code can be run without needing to call C# code from C++ (which I believe is hard / or just bad). | * Evaluate how much code must be ported to C# so that rendering and driving code can be run without needing to call C# code from C++ (which I believe is hard / or just bad / or impossible). | ||
* Do it! (if it sounds good). | * Do it! (if it sounds good). | ||
== Torcs 3D Engine. == | == Torcs 3D Engine. == | ||
=== Improving === | |||
A low cost way to get a more professional looking 3D engine is to improve the existing one little by little. Which what I believe to be a good way to do. | |||
Eventually I'll fork the existing engine, because it will certainly require a higher-end computer. | |||
Here is the list of improvements we can get, mainly by making use of OpenGL 2.0 features (Shaders, Buffers Objects). | |||
'''Without too much work''' we can achieve: | |||
* Per-pixel lighting [http://developer.nvidia.com/attach/6688] | |||
** Phong | |||
** Bump-mapping | |||
* High-quality illumination model | |||
** HDR rendering [http://en.wikipedia.org/wiki/High_dynamic_range_rendering] | |||
** Realistic atmospheric effects (FIXME. can't find illustrations.. watch this if you're not afraid of maths [http://www.ati.com/developer/dx9/ATI-LightScattering.pdf]) | |||
A '''little more work''': | |||
* Fake sky reflections on coachwork and metallic parts (my personal algorithm) [http://www.irit.fr/Lumiere/Galerie/sp_resize.php?source=./Work%20in%20progress/2006_05/f355/26-hq.png] | |||
'''Big work''': | |||
* Shadow Maps [http://developer.nvidia.com/dev_content/cg/cg_examples/images/hardware_shadow_maps.jpg] | |||
* Real reflections [http://www.irit.fr/Lumiere/Galerie/sp_resize.php?source=./Work%20in%20progress/2006_10/divers/snap41.png] | |||
=== New engine === | |||
'''Modular architecture already make this possible'''. | |||
The 3D engine implements an interface (defined in ''interfaces/graphic.h''), it is given the high-level information about the track and cars and have to build and display its own geometry from this. | The 3D engine implements an interface (defined in ''interfaces/graphic.h''), it is given the high-level information about the track and cars and have to build and display its own geometry from this. | ||
For now making a C# wrapper for the renderer would imply calling C# from C, is that possible? If possible, the whole ''src/interfaces'' headers have to be wrapped to C# then. | '''Make it in C# ?''' | ||
For now making a C# wrapper for the renderer would imply calling C# from C, is that possible? If possible, the whole ''src/interfaces'' headers have to be wrapped to C# then. (Cf ''Torcs in C#'') | |||
=== Notes by Jeko for Jeko === | === Notes by Jeko for Jeko === |
Revision as of 15:44, 12 June 2008
Torcs in C#
Preliminary tasks:
- Compile torcs as a library, with very high interface: TorcsLaunch().
- Make a C# wrapper to it.
- Launch torcs from Mono.
(see linux/main.cpp)
Secondary tasks:
- Evaluate how much code must be ported to C# so that rendering and driving code can be run without needing to call C# code from C++ (which I believe is hard / or just bad / or impossible).
- Do it! (if it sounds good).
Torcs 3D Engine.
Improving
A low cost way to get a more professional looking 3D engine is to improve the existing one little by little. Which what I believe to be a good way to do. Eventually I'll fork the existing engine, because it will certainly require a higher-end computer.
Here is the list of improvements we can get, mainly by making use of OpenGL 2.0 features (Shaders, Buffers Objects).
Without too much work we can achieve:
- Per-pixel lighting [1]
- Phong
- Bump-mapping
- High-quality illumination model
A little more work:
- Fake sky reflections on coachwork and metallic parts (my personal algorithm) [4]
Big work:
New engine
Modular architecture already make this possible. The 3D engine implements an interface (defined in interfaces/graphic.h), it is given the high-level information about the track and cars and have to build and display its own geometry from this.
Make it in C# ? For now making a C# wrapper for the renderer would imply calling C# from C, is that possible? If possible, the whole src/interfaces headers have to be wrapped to C# then. (Cf Torcs in C#)
Notes by Jeko for Jeko
It's almost pure OpenGL, so very easy to tweak.
Main work is done in src/modules/graphic/ssggraph/grmain.cpp
It builds a list of "screens" (main screen, mirrors, etc)
Each screen set up the opengl parameters he like and render track, then cars, etc..
Rendering of the car is done here: src/modules/graphic/ssggraph/grcar.cpp, grDrawCar()