Advertisement
Guest User

Untitled

a guest
Feb 11th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.77 KB | None | 0 0
  1. diff --git a/src/LmrModel.cpp b/src/LmrModel.cpp
  2. index 2bdd9c2..86eea1a 100644
  3. --- a/src/LmrModel.cpp
  4. +++ b/src/LmrModel.cpp
  5. @@ -55,13 +55,13 @@ namespace ShipThruster {
  6.     static void Init() {
  7.         thrusterProg = new Render::Shader("flat", "#define TEXTURE0 1\n");
  8.  
  9. -       thrusTex = s_textureCache->GetModelTexture(PIONEER_DATA_DIR"/textures/thruster.png");
  10. +       thrusTex = s_textureCache->GetModelTexture(PIONEER_DATA_DIR "/textures/thruster.png");
  11.         thrusTex->Bind();
  12.         thrusTex->SetWrapMode(Texture::CLAMP);
  13.  
  14. -       glowTex = s_textureCache->GetModelTexture(PIONEER_DATA_DIR"/textures/halo.png");
  15. +       glowTex = s_textureCache->GetModelTexture(PIONEER_DATA_DIR "/textures/halo.png");
  16.         glowTex->Bind();
  17. -       thrusTex->SetWrapMode(Texture::CLAMP);
  18. +       glowTex->SetWrapMode(Texture::CLAMP);
  19.         glowTex->Unbind();
  20.  
  21.         //zero at thruster center
  22. @@ -188,8 +188,8 @@ namespace ShipThruster {
  23.         vector3f viewdir = vector3f(-mv[2], -mv[6], -mv[10]).Normalized();
  24.         vector3f cdir(0.f, 0.f, -1.f);
  25.         //fade thruster out, when directly facing it
  26. -       float glow = 1.0 - Clamp(viewdir.Dot(cdir), 0.f, 1.f);
  27. -       color.a = pow(glow, 0.2f);
  28. +       float glow = 1.0 - Clamp(pow(viewdir.Dot(cdir), len*2), 0.f, 1.f);
  29. +       color.a = glow;//pow(glow, 0.1f);
  30.         thrusTex->Bind();
  31.         Render::State::UseProgram(thrusterProg);
  32.         thrusterProg->SetUniform("texture0", 0);
  33. @@ -206,8 +206,8 @@ namespace ShipThruster {
  34.         // linear thrusters get a secondary glow billboard
  35.         if (linear_only) {
  36.             glowTex->Bind();
  37. -           glow = Clamp(viewdir.Dot(cdir), 0.f, 1.f);
  38. -           color.a = pow(glow, 2.f);
  39. +           glow = Clamp(pow(viewdir.Dot(cdir), len), 0.f, 1.f);
  40. +           color.a = glow;//pow(glow, 2.f);
  41.             thrusterProg->SetUniform("color", color);
  42.             glColor4f(color.r, color.g, color.b, color.a);
  43.             glPushMatrix();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement