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:
parent
2d5e6c4909
commit
cf8be66654
9 changed files with 28 additions and 19 deletions
2
TODO
2
TODO
|
@ -1,4 +1,6 @@
|
||||||
Technology Preview 2 :
|
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.
|
- Render tab previews should not rerender when changing render options.
|
||||||
- Compute shadows only once for all textures at a same location.
|
- Compute shadows only once for all textures at a same location.
|
||||||
- Add antialiasing option (pay attention to memory usage).
|
- Add antialiasing option (pay attention to memory usage).
|
||||||
|
|
|
@ -95,6 +95,8 @@ public:
|
||||||
_renderer.camera_location.y = 20.0;
|
_renderer.camera_location.y = 20.0;
|
||||||
_renderer.camera_location.z = 0.0;
|
_renderer.camera_location.z = 0.0;
|
||||||
|
|
||||||
|
_zone = zoneCreate();
|
||||||
|
|
||||||
configScaling(0.1, 10.0, 0.1, 1.0);
|
configScaling(0.1, 10.0, 0.1, 1.0);
|
||||||
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
|
@ -110,6 +112,7 @@ protected:
|
||||||
void updateData()
|
void updateData()
|
||||||
{
|
{
|
||||||
texturesLayerCopyDefinition(&_layer, &_preview_layer);
|
texturesLayerCopyDefinition(&_layer, &_preview_layer);
|
||||||
|
zoneCopy(_zone, _preview_layer.zone);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
static Color _applyLightingToSurface(Renderer* renderer, Vector3 location, Vector3 normal, SurfaceMaterial material)
|
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);
|
return lightingApplyToSurface((LightingDefinition*)renderer->customData[0], renderer, location, normal, material);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Zone* _zone;
|
||||||
Renderer _renderer;
|
Renderer _renderer;
|
||||||
TextureLayerDefinition _preview_layer;
|
TextureLayerDefinition _preview_layer;
|
||||||
LightingDefinition _lighting;
|
LightingDefinition _lighting;
|
||||||
|
|
|
@ -8,6 +8,7 @@ MOC_DIR = ./moc/$$BUILDMODE/
|
||||||
DESTDIR = ../build/$$BUILDMODE/
|
DESTDIR = ../build/$$BUILDMODE/
|
||||||
CONFIG += $$BUILDMODE
|
CONFIG += $$BUILDMODE
|
||||||
|
|
||||||
|
LIBS += -lGLU
|
||||||
unix:LIBS += -L$$DESTDIR -lpaysages
|
unix:LIBS += -L$$DESTDIR -lpaysages
|
||||||
win32:LIBS += ../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0
|
win32:LIBS += ../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <GL/glu.h>
|
||||||
#include "../lib_paysages/scenery.h"
|
#include "../lib_paysages/scenery.h"
|
||||||
|
|
||||||
WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera):
|
WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera):
|
||||||
|
|
|
@ -499,7 +499,7 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>FormTextures</name>
|
<name>FormTextures</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="134"/>
|
<location filename="../gui_qt/formtextures.cpp" line="138"/>
|
||||||
<source>Coverage preview</source>
|
<source>Coverage preview</source>
|
||||||
<translation>Aperçu de la couverture</translation>
|
<translation>Aperçu de la couverture</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -508,77 +508,77 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<translation type="obsolete">Rendu en couleur</translation>
|
<translation type="obsolete">Rendu en couleur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="135"/>
|
<location filename="../gui_qt/formtextures.cpp" line="139"/>
|
||||||
<source>Lighted sample</source>
|
<source>Lighted sample</source>
|
||||||
<translation>Echantillon éclairé</translation>
|
<translation>Echantillon éclairé</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="137"/>
|
<location filename="../gui_qt/formtextures.cpp" line="141"/>
|
||||||
<source>Surface noise</source>
|
<source>Surface noise</source>
|
||||||
<translation>Bruit de surface</translation>
|
<translation>Bruit de surface</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="138"/>
|
<location filename="../gui_qt/formtextures.cpp" line="142"/>
|
||||||
<source>Surface noise height</source>
|
<source>Surface noise height</source>
|
||||||
<translation>Hauteur du bruit</translation>
|
<translation>Hauteur du bruit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="139"/>
|
<location filename="../gui_qt/formtextures.cpp" line="143"/>
|
||||||
<source>Surface noise scaling</source>
|
<source>Surface noise scaling</source>
|
||||||
<translation>Echelle du bruit</translation>
|
<translation>Echelle du bruit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="140"/>
|
<location filename="../gui_qt/formtextures.cpp" line="144"/>
|
||||||
<source>Base color</source>
|
<source>Base color</source>
|
||||||
<translation>Couleur de base</translation>
|
<translation>Couleur de base</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="141"/>
|
<location filename="../gui_qt/formtextures.cpp" line="145"/>
|
||||||
<source>Light reflection</source>
|
<source>Light reflection</source>
|
||||||
<translation>Réflexion de lumière</translation>
|
<translation>Réflexion de lumière</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="142"/>
|
<location filename="../gui_qt/formtextures.cpp" line="146"/>
|
||||||
<source>Light reflection shininess</source>
|
<source>Light reflection shininess</source>
|
||||||
<translation>Concentration de la lumière réfléchie</translation>
|
<translation>Concentration de la lumière réfléchie</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="145"/>
|
<location filename="../gui_qt/formtextures.cpp" line="149"/>
|
||||||
<source>Soft minimal height</source>
|
<source>Soft minimal height</source>
|
||||||
<translation>Altitude minimal (adoucie)</translation>
|
<translation>Altitude minimal (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="144"/>
|
<location filename="../gui_qt/formtextures.cpp" line="148"/>
|
||||||
<source>Hard minimal height</source>
|
<source>Hard minimal height</source>
|
||||||
<translation>Altitude minimale</translation>
|
<translation>Altitude minimale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="147"/>
|
<location filename="../gui_qt/formtextures.cpp" line="151"/>
|
||||||
<source>Hard maximal height</source>
|
<source>Hard maximal height</source>
|
||||||
<translation>Altitude maximale</translation>
|
<translation>Altitude maximale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="146"/>
|
<location filename="../gui_qt/formtextures.cpp" line="150"/>
|
||||||
<source>Soft maximal height</source>
|
<source>Soft maximal height</source>
|
||||||
<translation>Altitude maximale (adoucie)</translation>
|
<translation>Altitude maximale (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="149"/>
|
<location filename="../gui_qt/formtextures.cpp" line="153"/>
|
||||||
<source>Soft minimal slope</source>
|
<source>Soft minimal slope</source>
|
||||||
<translation>Pente minimale (adoucie)</translation>
|
<translation>Pente minimale (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="148"/>
|
<location filename="../gui_qt/formtextures.cpp" line="152"/>
|
||||||
<source>Hard minimal slope</source>
|
<source>Hard minimal slope</source>
|
||||||
<translation>Pente minimale</translation>
|
<translation>Pente minimale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="151"/>
|
<location filename="../gui_qt/formtextures.cpp" line="155"/>
|
||||||
<source>Hard maximal slope</source>
|
<source>Hard maximal slope</source>
|
||||||
<translation>Pente maximale</translation>
|
<translation>Pente maximale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="150"/>
|
<location filename="../gui_qt/formtextures.cpp" line="154"/>
|
||||||
<source>Soft maximal slope</source>
|
<source>Soft maximal slope</source>
|
||||||
<translation>Pente maximale (adoucie)</translation>
|
<translation>Pente maximale (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct RenderArea
|
||||||
RenderCallbackUpdate callback_update;
|
RenderCallbackUpdate callback_update;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*#define RENDER_INVERSE 1*/
|
#define RENDER_INVERSE 1
|
||||||
#define RENDER_WIREFRAME 1
|
#define RENDER_WIREFRAME 1
|
||||||
|
|
||||||
static void _callbackStart(int width, int height, Color background) {}
|
static void _callbackStart(int width, int height, Color background) {}
|
||||||
|
|
|
@ -86,8 +86,6 @@ typedef struct
|
||||||
double shininess;
|
double shininess;
|
||||||
} SurfaceMaterial;
|
} SurfaceMaterial;
|
||||||
|
|
||||||
typedef struct Zone Zone;
|
|
||||||
|
|
||||||
typedef void (*RenderCallbackStart)(int width, int height, Color background);
|
typedef void (*RenderCallbackStart)(int width, int height, Color background);
|
||||||
typedef void (*RenderCallbackDraw)(int x, int y, Color col);
|
typedef void (*RenderCallbackDraw)(int x, int y, Color col);
|
||||||
typedef void (*RenderCallbackUpdate)(double progress);
|
typedef void (*RenderCallbackUpdate)(double progress);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "noise.h"
|
#include "noise.h"
|
||||||
#include "lighting.h"
|
#include "lighting.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
|
#include "zone.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct Zone Zone;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
double value;
|
double value;
|
||||||
|
|
Loading…
Reference in a new issue