paysages: Fixed texture colored preview.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@307 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-04-27 20:05:33 +00:00 committed by ThunderK
parent 2d5e6c4909
commit cf8be66654
9 changed files with 28 additions and 19 deletions

2
TODO
View file

@ -1,4 +1,6 @@
Technology Preview 2 :
- When adding a texture layer (and maybe clouds), noise components cannot be used (they are always flat).
- Texture preview is sometimes all black.
- Render tab previews should not rerender when changing render options.
- Compute shadows only once for all textures at a same location.
- Add antialiasing option (pay attention to memory usage).

View file

@ -95,6 +95,8 @@ public:
_renderer.camera_location.y = 20.0;
_renderer.camera_location.z = 0.0;
_zone = zoneCreate();
configScaling(0.1, 10.0, 0.1, 1.0);
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
}
@ -110,6 +112,7 @@ protected:
void updateData()
{
texturesLayerCopyDefinition(&_layer, &_preview_layer);
zoneCopy(_zone, _preview_layer.zone);
}
private:
static Color _applyLightingToSurface(Renderer* renderer, Vector3 location, Vector3 normal, SurfaceMaterial material)
@ -117,6 +120,7 @@ private:
return lightingApplyToSurface((LightingDefinition*)renderer->customData[0], renderer, location, normal, material);
}
Zone* _zone;
Renderer _renderer;
TextureLayerDefinition _preview_layer;
LightingDefinition _lighting;

View file

@ -8,6 +8,7 @@ MOC_DIR = ./moc/$$BUILDMODE/
DESTDIR = ../build/$$BUILDMODE/
CONFIG += $$BUILDMODE
LIBS += -lGLU
unix:LIBS += -L$$DESTDIR -lpaysages
win32:LIBS += ../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0

View file

@ -4,6 +4,7 @@
#include <QKeyEvent>
#include <QTime>
#include <math.h>
#include <GL/glu.h>
#include "../lib_paysages/scenery.h"
WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera):

View file

@ -499,7 +499,7 @@ Maintenir Ctrl : Plus rapide</translation>
<context>
<name>FormTextures</name>
<message>
<location filename="../gui_qt/formtextures.cpp" line="134"/>
<location filename="../gui_qt/formtextures.cpp" line="138"/>
<source>Coverage preview</source>
<translation>Aperçu de la couverture</translation>
</message>
@ -508,77 +508,77 @@ Maintenir Ctrl : Plus rapide</translation>
<translation type="obsolete">Rendu en couleur</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="135"/>
<location filename="../gui_qt/formtextures.cpp" line="139"/>
<source>Lighted sample</source>
<translation>Echantillon éclairé</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="137"/>
<location filename="../gui_qt/formtextures.cpp" line="141"/>
<source>Surface noise</source>
<translation>Bruit de surface</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="138"/>
<location filename="../gui_qt/formtextures.cpp" line="142"/>
<source>Surface noise height</source>
<translation>Hauteur du bruit</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="139"/>
<location filename="../gui_qt/formtextures.cpp" line="143"/>
<source>Surface noise scaling</source>
<translation>Echelle du bruit</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="140"/>
<location filename="../gui_qt/formtextures.cpp" line="144"/>
<source>Base color</source>
<translation>Couleur de base</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="141"/>
<location filename="../gui_qt/formtextures.cpp" line="145"/>
<source>Light reflection</source>
<translation>Réflexion de lumière</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="142"/>
<location filename="../gui_qt/formtextures.cpp" line="146"/>
<source>Light reflection shininess</source>
<translation>Concentration de la lumière réfléchie</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="145"/>
<location filename="../gui_qt/formtextures.cpp" line="149"/>
<source>Soft minimal height</source>
<translation>Altitude minimal (adoucie)</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="144"/>
<location filename="../gui_qt/formtextures.cpp" line="148"/>
<source>Hard minimal height</source>
<translation>Altitude minimale</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="147"/>
<location filename="../gui_qt/formtextures.cpp" line="151"/>
<source>Hard maximal height</source>
<translation>Altitude maximale</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="146"/>
<location filename="../gui_qt/formtextures.cpp" line="150"/>
<source>Soft maximal height</source>
<translation>Altitude maximale (adoucie)</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="149"/>
<location filename="../gui_qt/formtextures.cpp" line="153"/>
<source>Soft minimal slope</source>
<translation>Pente minimale (adoucie)</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="148"/>
<location filename="../gui_qt/formtextures.cpp" line="152"/>
<source>Hard minimal slope</source>
<translation>Pente minimale</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="151"/>
<location filename="../gui_qt/formtextures.cpp" line="155"/>
<source>Hard maximal slope</source>
<translation>Pente maximale</translation>
</message>
<message>
<location filename="../gui_qt/formtextures.cpp" line="150"/>
<location filename="../gui_qt/formtextures.cpp" line="154"/>
<source>Soft maximal slope</source>
<translation>Pente maximale (adoucie)</translation>
</message>

View file

@ -33,7 +33,7 @@ struct RenderArea
RenderCallbackUpdate callback_update;
};
/*#define RENDER_INVERSE 1*/
#define RENDER_INVERSE 1
#define RENDER_WIREFRAME 1
static void _callbackStart(int width, int height, Color background) {}

View file

@ -86,8 +86,6 @@ typedef struct
double shininess;
} SurfaceMaterial;
typedef struct Zone Zone;
typedef void (*RenderCallbackStart)(int width, int height, Color background);
typedef void (*RenderCallbackDraw)(int x, int y, Color col);
typedef void (*RenderCallbackUpdate)(double progress);

View file

@ -5,6 +5,7 @@
#include "noise.h"
#include "lighting.h"
#include "pack.h"
#include "zone.h"
#ifdef __cplusplus
extern "C" {

View file

@ -8,6 +8,8 @@
extern "C" {
#endif
typedef struct Zone Zone;
typedef struct
{
double value;