mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +02:00
Merge pull request #804 from machinelevel/dev4
Rave tweaks: Use separate light settings for avatars and particles
This commit is contained in:
commit
ef63553b72
3 changed files with 38 additions and 10 deletions
|
@ -1159,6 +1159,10 @@ void Avatar::render(bool lookingInMirror, bool renderAvatarBalls) {
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Application::getInstance()->getAvatar()->getHand().isRaveGloveActive()) {
|
||||||
|
_hand.setRaveLights(RAVE_LIGHTS_AVATAR);
|
||||||
|
}
|
||||||
|
|
||||||
// render a simple round on the ground projected down from the avatar's position
|
// render a simple round on the ground projected down from the avatar's position
|
||||||
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f);
|
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f);
|
||||||
|
|
||||||
|
@ -1225,16 +1229,6 @@ void Avatar::renderScreenTint(ScreenTintLayer layer, Camera& whichCamera) {
|
||||||
if (layer == SCREEN_TINT_BEFORE_AVATARS) {
|
if (layer == SCREEN_TINT_BEFORE_AVATARS) {
|
||||||
if (_hand.isRaveGloveActive()) {
|
if (_hand.isRaveGloveActive()) {
|
||||||
_hand.renderRaveGloveStage();
|
_hand.renderRaveGloveStage();
|
||||||
|
|
||||||
// Set some mood lighting
|
|
||||||
GLfloat ambient_color[] = { 0.0, 0.0, 0.0 };
|
|
||||||
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
|
|
||||||
GLfloat diffuse_color[] = { 0.4, 0.0, 0.0 };
|
|
||||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);
|
|
||||||
GLfloat specular_color[] = { 0.0, 0.0, 0.0, 0.0};
|
|
||||||
glLightfv(GL_LIGHT0, GL_SPECULAR, specular_color);
|
|
||||||
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
|
||||||
glMateriali(GL_FRONT, GL_SHININESS, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (layer == SCREEN_TINT_BEFORE_AVATARS) {
|
else if (layer == SCREEN_TINT_BEFORE_AVATARS) {
|
||||||
|
|
|
@ -145,6 +145,9 @@ void Hand::render(bool lookingInMirror) {
|
||||||
|
|
||||||
if (_raveGloveInitialized) {
|
if (_raveGloveInitialized) {
|
||||||
updateRaveGloveEmitters(); // do this after calculateGeometry
|
updateRaveGloveEmitters(); // do this after calculateGeometry
|
||||||
|
|
||||||
|
// Use normal lighting for the particles
|
||||||
|
setRaveLights(RAVE_LIGHTS_PARTICLES);
|
||||||
_raveGloveParticleSystem.render();
|
_raveGloveParticleSystem.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,6 +164,31 @@ void Hand::render(bool lookingInMirror) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Hand::setRaveLights(RaveLightsSetting setting) {
|
||||||
|
if (setting == RAVE_LIGHTS_AVATAR) {
|
||||||
|
// Set some mood lighting
|
||||||
|
GLfloat ambient_color[] = { 0.0, 0.0, 0.0 };
|
||||||
|
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
|
||||||
|
GLfloat diffuse_color[] = { 0.4, 0.0, 0.0 };
|
||||||
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);
|
||||||
|
GLfloat specular_color[] = { 0.0, 0.0, 0.0, 0.0};
|
||||||
|
glLightfv(GL_LIGHT0, GL_SPECULAR, specular_color);
|
||||||
|
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
||||||
|
glMateriali(GL_FRONT, GL_SHININESS, 0);
|
||||||
|
}
|
||||||
|
else if (setting == RAVE_LIGHTS_PARTICLES) {
|
||||||
|
// particles use a brighter light setting
|
||||||
|
GLfloat ambient_color[] = { 0.7, 0.7, 0.8 };
|
||||||
|
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color);
|
||||||
|
GLfloat diffuse_color[] = { 0.8, 0.7, 0.7 };
|
||||||
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse_color);
|
||||||
|
GLfloat specular_color[] = { 1.0, 1.0, 1.0, 1.0};
|
||||||
|
glLightfv(GL_LIGHT0, GL_SPECULAR, specular_color);
|
||||||
|
glMaterialfv(GL_FRONT, GL_SPECULAR, specular_color);
|
||||||
|
glMateriali(GL_FRONT, GL_SHININESS, 96);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Hand::renderRaveGloveStage() {
|
void Hand::renderRaveGloveStage() {
|
||||||
if (_owningAvatar && _owningAvatar->isMyAvatar()) {
|
if (_owningAvatar && _owningAvatar->isMyAvatar()) {
|
||||||
Head& head = _owningAvatar->getHead();
|
Head& head = _owningAvatar->getHead();
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
enum RaveLightsSetting {
|
||||||
|
RAVE_LIGHTS_AVATAR = 0,
|
||||||
|
RAVE_LIGHTS_PARTICLES
|
||||||
|
};
|
||||||
|
|
||||||
class Avatar;
|
class Avatar;
|
||||||
class ProgramObject;
|
class ProgramObject;
|
||||||
|
|
||||||
|
@ -42,6 +47,7 @@ public:
|
||||||
void simulate(float deltaTime, bool isMine);
|
void simulate(float deltaTime, bool isMine);
|
||||||
void render(bool lookingInMirror);
|
void render(bool lookingInMirror);
|
||||||
void renderRaveGloveStage();
|
void renderRaveGloveStage();
|
||||||
|
void setRaveLights(RaveLightsSetting setting);
|
||||||
|
|
||||||
void setBallColor (glm::vec3 ballColor ) { _ballColor = ballColor; }
|
void setBallColor (glm::vec3 ballColor ) { _ballColor = ballColor; }
|
||||||
void updateRaveGloveParticles(float deltaTime);
|
void updateRaveGloveParticles(float deltaTime);
|
||||||
|
|
Loading…
Reference in a new issue