Page 4 of 7

Re: a nice cavern filled with lava

Posted: Fri Jul 31, 2015 12:52 am
by minmay
The mesh itself won't change, no. The ocean_water shader does kind of change the mesh (it also only works on materials that are named "ocean_water", "water_surface_calm", or "water_surface_underwater"...) but not any of the others.

Re: a nice cavern filled with lava

Posted: Fri Jul 31, 2015 1:19 am
by AndakRainor
Well it changes the mesh on my material named "lava_surface"

Re: a nice cavern filled with lava

Posted: Fri Jul 31, 2015 1:55 am
by minmay
I didn't mean it doesn't work as in it does literally nothing. I meant it doesn't work as in it doesn't behave correctly.

Re: a nice cavern filled with lava

Posted: Fri Jul 31, 2015 4:08 pm
by bongobeat
I prefer some kind of "static" lava: too much move like the ocean is weird (specially on the corner), or can be used for a lava river, but here I think it looks better with low speed.

I use the beach_ground_normal and another diffuse texture (red). Anyway this is weird too. Couldn't find a correct texture.
SpoilerShow
Image
http://www.photo-graphix.fr/storephoto/ ... vatest.dds

here is the code:
SpoilerShow

Code: Select all


    defineObject{
      name = "lava_effects",
      components = {
        { class = "Light",
          offset = vec(0, -0.5, 0),
          range = 6,
          color = vec(2.8, 1.2, 0.7),
          brightness = 10,
          castShadow = true,
          shadowMapSize = 64,
          staticShadows = true,
          staticShadowDistance = 0,   -- use static shadows always
        },
        { class = "Particle",
          particleSystem = "lava_effects",
          offset = vec(0, -0.4, 0),
        },
        {
          class = "TileDamager",
          attackPower = 3,
          damageType = "fire",
          repeatCount = math.huge,
          repeatDelay = 1,
          onInit = function(self)
            if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
              spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
            end
          end,
        },
        { class = "Timer",
          timerInterval = 1,
          triggerOnStart = true,
          onActivate = function(self)
playSound("magma_golem_meteor_fall")
            spawn("magma_golem_meteor_impact_ground", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
            self:setTimerInterval(300*(0.1+0.9*math.random()))
          end,
          onInit = function(self)
            self:setTimerInterval(300*math.random())
          end,
        },
        { class = "Sound",
          sound = "fire_pit",
          volume = 0.5,
        },
      },
      placement = "floor",
      editorIcon = 88,
    }

    defineObject{
      name = "under_lava_effects",
      components = {
        { class = "Particle",
          particleSystem = "under_lava_effects",
        },
        {
          class = "TileDamager",
          attackPower = 15,
          damageType = "fire",
          repeatCount = math.huge,
          repeatDelay = 1,
          onInit = function(self)
            if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
              spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
            end
          end,
        },
      },
      placement = "floor",
      editorIcon = 88,
    }

    defineObject{
      name = "lava_surface",
      components = {
        {
          class = "Model",
          model = "assets/models/env/ocean_water.fbx",
          material = "lava_surface",
          offset = vec(0, -0.4, 0),
        },
      },
      placement = "floor",
      dontAdjustHeight = true,
      editorIcon = 264,
      reflectionMode = "never",
    }

    defineObject{
      name = "lava_surface_tiles",
      baseObject = "base_floor_decoration",
      components = {
        {
          -- updates global reflection and refraction maps
          class = "WaterSurface",
          planeY = -0.4,
          fogColor = math.saturation(vec(0.26, 0.09, 0.042), 0.5) * 0.5,
          fogDensity = 0.4,
          reflectionColor = vec(1.5, 0.9, 0.27) * 0.9,
          refractionColor = vec(1.5,1.0,0.5),
        },
        {
          -- builds a continuous mesh from underwater tiles
          class = "WaterSurfaceMesh",
          material = "lava_surface_tiles",
          underwaterMaterial = "water_surface_underwater",
          offset = vec(0, -0.4, 0),
        },
      },
      dontAdjustHeight = true,
      editorIcon = 264,
    }

    defineMaterial{
      name = "lava_surface",
      shader = "ocean_water",
      diffuseMap = "mod_assets/lava/lavatest.tga",      
	normalMap = "assets/textures/env/beach_ground_normal.tga",
      displacementMap = "assets/textures/env/ocean_disp.tga",

      doubleSided = true,
      --lighting = true,
      alphaTest = false,
      --castShadow = true,
      blendMode = "Opaque",
      textureAddressMode = "Wrap",
      glossiness = 0,
      depthBias = 0,
      texOffset = 0,
      foamOffset = 0,
      foamAmount = 0,
      waveAmplitude = 40,
      onUpdate = function(self, time)
        self:setTexcoordScaleOffset(1, 1, math.cos(time*0.02)*0.25, math.sin(time*0.02)*0.25)
      end,
    }

    defineMaterial{
      name = "lava_surface_tiles",
      shader = "ocean_water",
      diffuseMap = "mod_assets/lava/lavatest.tga",
      normalMap = "assets/textures/env/beach_ground_normal.tga",
      displacementMap = "assets/textures/env/ocean_disp.tga",
      doubleSided = false,
      --lighting = true,
      alphaTest = false,
      --castShadow = true,
      blendMode = "Opaque",
      textureAddressMode = "Wrap",
      glossiness = 0,
      depthBias = 0,
      texOffset = 0,
      foamOffset = 0,
      foamAmount = 0,
      waveAmplitude = 10,
      onUpdate = function(self, time)
        self:setTexcoordScaleOffset(1, 1, math.cos(time*0.02)*0.25, math.sin(time*0.02)*0.25)
      end,
    }

    defineParticleSystem{
      name = "lava_effects",
      emitters = {
        -- stars
        {
          emissionRate = 40,
          emissionTime = 0,
          maxParticles = 200,
          boxMin = {-1.3, 0.0,-1.3},
          boxMax = { 1.3, 0.5, 1.3},
          sprayAngle = {0,360},
          velocity = {0,0},
          objectSpace = true,
          texture = "assets/textures/particles/firefly_dif.tga",
          lifetime = {0.5,5.0},
          color0 = {4, 0.4, 0.2},
          opacity = 1,
          fadeIn = 0.1,
          fadeOut = 1.0,
          size = {0.05, 0.1},
          gravity = {0,0.5,0},
          airResistance = 0.1,
          rotationSpeed = 5,
          blendMode = "Additive",
        },
        -- flames 1
        {
          emissionRate = 5,
          emissionTime = 0,
          maxParticles = 5,
          boxMin = {-1.5, -0.2,-1.5},
          boxMax = { 1.5, -0.0, 1.5},
          sprayAngle = {0,360},
          velocity = {0,0},
          objectSpace = false,
          texture = "assets/textures/particles/flame.tga",
          frameSize = 32,
          frameCount = 40,
          frameRate = 60,
          lifetime = {0.5,1.0},
          color0 = {4, 0.4, 0.2},
          opacity = 0.5,
          fadeIn = 0.5,
          fadeOut = 0.5,
          size = {0.5, 0.5},
          gravity = {0,0.02,0},
          airResistance = 0.1,
          rotationSpeed = 1,
          blendMode = "Additive",
        },
        -- flames 2
        {
          emissionRate = 5,
          emissionTime = 0,
          maxParticles = 5,
          boxMin = {-1.5, -0.2,-1.5},
          boxMax = { 1.5, -0.0, 1.5},
          sprayAngle = {0,360},
          velocity = {0,0},
          objectSpace = false,
          texture = "assets/textures/particles/flame.tga",
          frameSize = 32,
          frameCount = 40,
          frameRate = 60,
          lifetime = {0.5,1.0},
          color0 = {4, 0.4, 0.2},
          opacity = 0.5,
          fadeIn = 0.5,
          fadeOut = 0.5,
          size = {0.5, 0.5},
          gravity = {0,0.02,0},
          airResistance = 0.1,
          rotationSpeed = -1,
          blendMode = "Additive",
        },
        -- smoke
        {
          emissionRate = 4,
          emissionTime = 0,
          maxParticles = 40,
          boxMin = {-1.3, 0, -1.3},
          boxMax = { 1.3, 1.0, 1.3},
          sprayAngle = {0,20},
          velocity = {0.4, 0.8},
          texture = "assets/textures/particles/smoke_01.tga",
          lifetime = {1,5},
          color0 = {0.25, 0.20, 0.17},
          opacity = 0.5,
          fadeIn = 0.3,
          fadeOut = 0.9,
          size = {1.5, 2},
          gravity = {0,0.3,0},
          airResistance = 0.1,
          rotationSpeed = 0.5,
          blendMode = "Translucent",
        },
      }
    }

    defineParticleSystem{
      name = "under_lava_effects",
      emitters = {
        -- fog under 1
        {
          emissionRate = 1,
          emissionTime = 0,
          maxParticles = 10,
          boxMin = {-1.5, -0.5, -1.5},
          boxMax = { 1.5,  2.5,  1.5},
          sprayAngle = {0,360},
          velocity = {0,0},
          objectSpace = true,
          texture = "assets/textures/particles/fog.tga",
          lifetime = {10,10},
          color0 = {1.75,0.46,0.18},
          opacity = 1,
          fadeIn = 2.5,
          fadeOut = 2.5,
          size = {4, 4},
          gravity = {0,0,0},
          airResistance = 0.5,
          rotationSpeed = -0.3,
          blendMode = "Translucent",
        },
        -- fog under 2
        {
          emissionRate = 1,
          emissionTime = 0,
          maxParticles = 10,
          boxMin = {-1.5, -0.5, -1.5},
          boxMax = { 1.5,  2.5,  1.5},
          sprayAngle = {0,360},
          velocity = {0,0},
          objectSpace = true,
          texture = "assets/textures/particles/fog.tga",
          lifetime = {10,10},
          color0 = {1.75,0.36,0.18},
          opacity = 1,
          fadeIn = 2.5,
          fadeOut = 2.5,
          size = {3, 3},
          gravity = {0,0,0},
          airResistance = 0.5,
          rotationSpeed = 0.3,
          blendMode = "Translucent",
        },
      }
    }
What it need too is something like an "eruption" particle.
SpoilerShow
Image
If that can be done?

edit:
I've added a sound in your code, when the magma_golem_meteor_impact_ground is spawned

Re: a nice cavern filled with lava

Posted: Fri Jul 31, 2015 6:46 pm
by AndakRainor
Another try:
SpoilerShow
Image
the code:
SpoilerShow

Code: Select all

defineObject{
  name = "lava_effects",
  components = {
    { class = "Light",
      offset = vec(0, -0.5, 0),
      range = 6,
      color = vec(2.8, 1.2, 0.7),
      brightness = 10,
      castShadow = true,
      shadowMapSize = 64,
      staticShadows = true,
      staticShadowDistance = 0,   -- use static shadows always
    },
    { class = "Particle",
      particleSystem = "lava_effects",
      offset = vec(0, -0.4, 0),
    },
    {
      class = "TileDamager",
      attackPower = 3,
      damageType = "fire",
      repeatCount = math.huge,
      repeatDelay = 1,
      onInit = function(self)
        if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
          spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
        end
      end,
    },
    { class = "Timer",
      timerInterval = 1,
      triggerOnStart = true,
      onActivate = function(self)
        self.go:playSound("magma_golem_meteor_fall")
        spawn("magma_golem_meteor_impact_ground", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
        self:setTimerInterval(300*(0.1+0.9*math.random()))
      end,
      onInit = function(self)
        self:setTimerInterval(300*math.random())
      end,
    },
    { class = "Sound",
      sound = "fire_pit",
      volume = 0.5,
    },
  },
  placement = "floor",
  editorIcon = 88,
}

defineObject{
  name = "under_lava_effects",
  components = {
    { class = "Particle",
      particleSystem = "under_lava_effects",
    },
    {
      class = "TileDamager",
      attackPower = 15,
      damageType = "fire",
      repeatCount = math.huge,
      repeatDelay = 1,
      onInit = function(self)
        if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
          spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
        end
      end,
    },
  },
  placement = "floor",
  editorIcon = 88,
}

defineObject{
  name = "lava_surface",
  components = {
    {
      class = "Model",
      model = "assets/models/env/ocean_water.fbx",
      material = "lava_surface",
      offset = vec(0, -0.4, 0),
    },
  },
  placement = "floor",
  dontAdjustHeight = true,
  editorIcon = 264,
  reflectionMode = "never",
}

defineObject{
  name = "lava_surface_tiles",
  baseObject = "base_floor_decoration",
  components = {
    {
      -- updates global reflection and refraction maps
      class = "WaterSurface",
      planeY = -0.4,
      fogColor = math.saturation(vec(0.26, 0.09, 0.042), 0.5) * 0.5,
      fogDensity = 0.4,
      reflectionColor = vec(1.5, 0.9, 0.27) * 0.9,
      refractionColor = vec(1.5,1.0,0.5),
    },
    {
      -- builds a continuous mesh from underwater tiles
      class = "WaterSurfaceMesh",
      material = "lava_surface_tiles",
      underwaterMaterial = "lava_surface_tiles",
      offset = vec(0, -0.4, 0),
    },
  },
  dontAdjustHeight = true,
  editorIcon = 264,
}

defineMaterial{
  name = "lava_surface",
  shader = "ocean_water",
  diffuseMap = "mod_assets/textures/env/lava_dif.tga",
  normalMap = "assets/textures/env/beach_ground_normal.tga",
  emissiveMap = "mod_assets/textures/env/lava_emissive.tga",
  displacementMap = "assets/textures/env/ocean_disp.tga",
  doubleSided = true,
  --lighting = true,
  alphaTest = false,
  --castShadow = true,
  blendMode = "Opaque",
  textureAddressMode = "Wrap",
  glossiness = 0,
  depthBias = 0,
  texOffset = 0,
  foamOffset = 0,
  foamAmount = 0,
  waveAmplitude = 25, 
  onUpdate = function(self, time)
    self:setTexcoordScaleOffset(4, 4, math.cos(time*0.125)*0.5, math.sin(time*0.125)*0.5)
  end,
}

defineMaterial{
  name = "lava_surface_tiles",
  shader = "ocean_water",
  diffuseMap = "mod_assets/textures/env/lava_dif.tga",
  normalMap = "assets/textures/env/beach_ground_normal.tga",
  emissiveMap = "mod_assets/textures/env/lava_emissive.tga",
  displacementMap = "assets/textures/env/ocean_disp.tga",
  doubleSided = false,
  --lighting = true,
  alphaTest = false,
  --castShadow = true,
  blendMode = "Opaque",
  textureAddressMode = "Wrap",
  glossiness = 0,
  depthBias = 0,
  texOffset = 0,
  foamOffset = 0,
  foamAmount = 0,
  waveAmplitude = 0.5, 
  onUpdate = function(self, time)
    self:setTexcoordScaleOffset(1, 1, math.cos(time*0.0625)*0.125, math.sin(time*0.0625)*0.125)
  end,
}

defineParticleSystem{
  name = "lava_effects",
  emitters = {
    -- stars
    {
      emissionRate = 40,
      emissionTime = 0,
      maxParticles = 200,
      boxMin = {-1.3, 0.0,-1.3},
      boxMax = { 1.3, 0.5, 1.3},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = true,
      texture = "assets/textures/particles/firefly_dif.tga",
      lifetime = {0.5,5.0},
      color0 = {4, 0.4, 0.2},
      opacity = 1,
      fadeIn = 0.1,
      fadeOut = 1.0,
      size = {0.05, 0.1},
      gravity = {0,0.5,0},
      airResistance = 0.1,
      rotationSpeed = 5,
      blendMode = "Additive",
    },
    -- flames 1
    {
      emissionRate = 5,
      emissionTime = 0,
      maxParticles = 5,
      boxMin = {-1.5, -0.2,-1.5},
      boxMax = { 1.5, -0.0, 1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = false,
      texture = "assets/textures/particles/flame.tga",
      frameSize = 32,
      frameCount = 40,
      frameRate = 60,
      lifetime = {0.5,1.0},
      color0 = {4, 0.4, 0.2},
      opacity = 0.5,
      fadeIn = 0.5,
      fadeOut = 0.5,
      size = {0.5, 0.5},
      gravity = {0,0.02,0},
      airResistance = 0.1,
      rotationSpeed = 1,
      blendMode = "Additive",
    },
    -- flames 2
    {
      emissionRate = 5,
      emissionTime = 0,
      maxParticles = 5,
      boxMin = {-1.5, -0.2,-1.5},
      boxMax = { 1.5, -0.0, 1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = false,
      texture = "assets/textures/particles/flame.tga",
      frameSize = 32,
      frameCount = 40,
      frameRate = 60,
      lifetime = {0.5,1.0},
      color0 = {4, 0.4, 0.2},
      opacity = 0.5,
      fadeIn = 0.5,
      fadeOut = 0.5,
      size = {0.5, 0.5},
      gravity = {0,0.02,0},
      airResistance = 0.1,
      rotationSpeed = -1,
      blendMode = "Additive",
    },
    -- smoke
    {
      emissionRate = 4,
      emissionTime = 0,
      maxParticles = 40,
      boxMin = {-1.3, 0, -1.3},
      boxMax = { 1.3, 1.0, 1.3},
      sprayAngle = {0,20},
      velocity = {0.4, 0.8},
      texture = "assets/textures/particles/smoke_01.tga",
      lifetime = {1,5},
      color0 = {0.25, 0.20, 0.17},
      opacity = 0.5,
      fadeIn = 0.3,
      fadeOut = 0.9,
      size = {1.5, 2},
      gravity = {0,0.3,0},
      airResistance = 0.1,
      rotationSpeed = 0.5,
      blendMode = "Translucent",
    },
  }
}

defineParticleSystem{
  name = "under_lava_effects",
  emitters = {
    -- fog under 1
    {
      emissionRate = 1,
      emissionTime = 0,
      maxParticles = 10,
      boxMin = {-1.5, -0.5, -1.5},
      boxMax = { 1.5,  2.5,  1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = true,
      texture = "assets/textures/particles/fog.tga",
      lifetime = {10,10},
      color0 = {1.75,0.6,0.2},
      opacity = 1,
      fadeIn = 2.5,
      fadeOut = 2.5,
      size = {5, 5},
      gravity = {0,0,0},
      airResistance = 0.5,
      rotationSpeed = -0.3,
      blendMode = "Translucent",
    },
    -- fog under 2
    {
      emissionRate = 1,
      emissionTime = 0,
      maxParticles = 10,
      boxMin = {-1.5, -0.5, -1.5},
      boxMax = { 1.5,  2.5,  1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = true,
      texture = "assets/textures/particles/fog.tga",
      lifetime = {10,10},
      color0 = {1.75,0.6,0.2},
      opacity = 1,
      fadeIn = 2.5,
      fadeOut = 2.5,
      size = {5, 5},
      gravity = {0,0,0},
      airResistance = 0.5,
      rotationSpeed = 0.3,
      blendMode = "Translucent",
    },
  }
}
This time I used an emissiveMap for brightness, scaled the texture down, and reduced the wave amplitude. the 2 textures are here : http://ge.tt/9HPTdWE2

Also I added self.go:playSound("magma_golem_meteor_fall") instead of just playSound for the 3D effect.

I have just a weird "white blue" result when the surface is seen from under. But should we see lava from under in a mod ? ;)
What do you think ?
PS: I will see what can be done for the eruption effect.

Re: a nice cavern filled with lava

Posted: Fri Jul 31, 2015 7:08 pm
by Komag
Now that's looking much better!

Re: a nice cavern filled with lava

Posted: Sat Aug 01, 2015 12:12 am
by Dr.Disaster
AndakRainor wrote:Another try:
SpoilerShow
Image
Nice; maybe a bit much on the fog part.

Re: a nice cavern filled with lava

Posted: Sat Aug 01, 2015 6:35 pm
by Emera Nova
AndakRainor it appears that your one file may be broken as it doesn't download. The lava_dif.dds is the file that won't download.

Re: a nice cavern filled with lava

Posted: Sat Aug 01, 2015 7:45 pm
by AndakRainor
That's odd... I re-uploaded it now it works.

Re: a nice cavern filled with lava

Posted: Sat Aug 01, 2015 7:55 pm
by AndakRainor
The last version of the code for lava:
SpoilerShow

Code: Select all

defineObject{
  name = "lava_effects",
  components = {
    { class = "Light",
      offset = vec(0, -0.5, 0),
      range = 6,
      color = vec(2.8, 1.2, 0.7),
      brightness = 10,
      castShadow = true,
      shadowMapSize = 64,
      staticShadows = true,
      staticShadowDistance = 0,   -- use static shadows always
    },
    { class = "Particle",
      particleSystem = "lava_effects",
      offset = vec(0, -0.4, 0),
    },
    {
      class = "TileDamager",
      attackPower = 3,
      damageType = "fire",
      repeatCount = math.huge,
      repeatDelay = 1,
      onInit = function(self)
        if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
          spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
        end
      end,
    },
    { class = "Timer",
      timerInterval = 1,
      triggerOnStart = true,
      onActivate = function(self)
        self.go:playSound("magma_explosion")
        spawn("magma_golem_meteor_impact_ground", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
        self:setTimerInterval(300*(0.1+0.9*math.random()))
      end,
      onInit = function(self)
        self:setTimerInterval(300*math.random())
      end,
    },
    { class = "Sound",
      sound = "fire_pit",
      volume = 0.5,
    },
  },
  placement = "floor",
  editorIcon = 88,
}

defineObject{
  name = "under_lava_effects",
  components = {
    { class = "Particle",
      particleSystem = "under_lava_effects",
    },
    {
      class = "TileDamager",
      attackPower = 15,
      damageType = "fire",
      repeatCount = math.huge,
      repeatDelay = 1,
      onInit = function(self)
        if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
          spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
        end
      end,
    },
  },
  placement = "floor",
  editorIcon = 88,
}

defineObject{
  name = "lava_surface",
  components = {
    {
      class = "Model",
      model = "assets/models/env/ocean_water.fbx",
      material = "lava_surface",
      offset = vec(0, -0.4, 0),
    },
  },
  placement = "floor",
  dontAdjustHeight = true,
  editorIcon = 264,
  reflectionMode = "never",
}

defineObject{
  name = "lava_surface_tiles",
  baseObject = "base_floor_decoration",
  components = {
    {
      -- updates global reflection and refraction maps
      class = "WaterSurface",
      planeY = -0.4,
      fogColor = math.saturation(vec(0.26, 0.09, 0.042), 0.5) * 0.5,
      fogDensity = 0.4,
      reflectionColor = vec(1.5, 0.9, 0.27) * 0.9,
      refractionColor = vec(1.5,1.0,0.5),
    },
    {
      -- builds a continuous mesh from underwater tiles
      class = "WaterSurfaceMesh",
      material = "lava_surface_tiles",
      underwaterMaterial = "lava_surface_tiles",
      offset = vec(0, -0.4, 0),
    },
  },
  dontAdjustHeight = true,
  editorIcon = 264,
}

defineMaterial{
  name = "lava_surface",
  shader = "ocean_water",
  diffuseMap = "mod_assets/textures/env/lava_dif.tga",
  normalMap = "assets/textures/env/beach_ground_normal.tga",
  emissiveMap = "mod_assets/textures/env/lava_emissive.tga",
  displacementMap = "assets/textures/env/ocean_disp.tga",
  doubleSided = true,
  lighting = true,
  alphaTest = false,
  castShadow = false,
  blendMode = "Opaque",
  textureAddressMode = "Wrap",
  glossiness = 0,
  depthBias = 0,
  texOffset = 0,
  foamOffset = 0,
  foamAmount = 0,
  waveAmplitude = 0, 
  onUpdate = function(self, time)
    self:setTexcoordScaleOffset(4, 4, math.cos(time*0.125)*0.5, math.sin(time*0.125)*0.5)
    self:setParam("waveAmplitude", 0.0625*time)
  end,
}

defineMaterial{
  name = "lava_surface_tiles",
  shader = "ocean_water",
  diffuseMap = "mod_assets/textures/env/lava_dif.tga",
  normalMap = "assets/textures/env/beach_ground_normal.tga",
  emissiveMap = "mod_assets/textures/env/lava_emissive.tga",
  displacementMap = "assets/textures/env/ocean_disp.tga",
  doubleSided = true,
  lighting = true,
  alphaTest = false,
  castShadow = false,
  blendMode = "Opaque",
  textureAddressMode = "Wrap",
  glossiness = 0,
  depthBias = 0,
  texOffset = 0,
  foamOffset = 0,
  foamAmount = 0,
  waveAmplitude = 0, 
  onUpdate = function(self, time)
    self:setTexcoordScaleOffset(4, 4, math.cos(time*0.125)*0.5, math.sin(time*0.125)*0.5)
    self:setParam("waveAmplitude", 0.000625*time)
  end,
}

defineParticleSystem{
  name = "lava_effects",
  emitters = {
    -- stars
    {
      emissionRate = 40,
      emissionTime = 0,
      maxParticles = 200,
      boxMin = {-1.3, 0.0,-1.3},
      boxMax = { 1.3, 0.5, 1.3},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = true,
      texture = "assets/textures/particles/firefly_dif.tga",
      lifetime = {0.5,5.0},
      color0 = {4, 0.4, 0.2},
      opacity = 1,
      fadeIn = 0.1,
      fadeOut = 1.0,
      size = {0.05, 0.1},
      gravity = {0,0.5,0},
      airResistance = 0.1,
      rotationSpeed = 5,
      blendMode = "Additive",
    },
    -- flames 1
    {
      emissionRate = 5,
      emissionTime = 0,
      maxParticles = 5,
      boxMin = {-1.5, -0.1,-1.5},
      boxMax = { 1.5, -0.1, 1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = false,
      texture = "assets/textures/particles/flame.tga",
      frameSize = 32,
      frameCount = 40,
      frameRate = 60,
      lifetime = {0.5,1.0},
      color0 = {4, 0.4, 0.2},
      opacity = 0.5,
      fadeIn = 0.5,
      fadeOut = 0.5,
      size = {0.5, 0.5},
      gravity = {0,0.02,0},
      airResistance = 0.1,
      rotationSpeed = 1,
      blendMode = "Additive",
    },
    -- flames 2
    {
      emissionRate = 5,
      emissionTime = 0,
      maxParticles = 5,
      boxMin = {-1.5, -0.1,-1.5},
      boxMax = { 1.5, -0.1, 1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = false,
      texture = "assets/textures/particles/flame.tga",
      frameSize = 32,
      frameCount = 40,
      frameRate = 60,
      lifetime = {0.5,1.0},
      color0 = {4, 0.4, 0.2},
      opacity = 0.5,
      fadeIn = 0.5,
      fadeOut = 0.5,
      size = {0.5, 0.5},
      gravity = {0,0.02,0},
      airResistance = 0.1,
      rotationSpeed = -1,
      blendMode = "Additive",
    },
    -- smoke
    {
      emissionRate = 4,
      emissionTime = 0,
      maxParticles = 40,
      boxMin = {-1.3, 0, -1.3},
      boxMax = { 1.3, 1.0, 1.3},
      sprayAngle = {0,20},
      velocity = {0.4, 0.8},
      texture = "assets/textures/particles/smoke_01.tga",
      lifetime = {1,5},
      color0 = {0.25, 0.20, 0.17},
      opacity = 0.5,
      fadeIn = 0.3,
      fadeOut = 0.9,
      size = {1.5, 2},
      gravity = {0,0.3,0},
      airResistance = 0.1,
      rotationSpeed = 0.5,
      blendMode = "Translucent",
    },
  }
}

defineParticleSystem{
  name = "under_lava_effects",
  emitters = {
    -- fog under 1
    {
      emissionRate = 1,
      emissionTime = 0,
      maxParticles = 10,
      boxMin = {-1.5, -1.0, -1.5},
      boxMax = { 1.5,  2.0,  1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = true,
      texture = "assets/textures/particles/fog.tga",
      lifetime = {10,10},
      color0 = {1.75,0.6,0.2},
      opacity = 1,
      fadeIn = 2.5,
      fadeOut = 2.5,
      size = {5, 5},
      gravity = {0,0,0},
      airResistance = 0.5,
      rotationSpeed = -0.3,
      blendMode = "Translucent",
    },
    -- fog under 2
    {
      emissionRate = 1,
      emissionTime = 0,
      maxParticles = 10,
      boxMin = {-1.5, -1.0, -1.5},
      boxMax = { 1.5,  2.0,  1.5},
      sprayAngle = {0,360},
      velocity = {0,0},
      objectSpace = true,
      texture = "assets/textures/particles/fog.tga",
      lifetime = {10,10},
      color0 = {1.75,0.6,0.2},
      opacity = 1,
      fadeIn = 2.5,
      fadeOut = 2.5,
      size = {5, 5},
      gravity = {0,0,0},
      airResistance = 0.5,
      rotationSpeed = 0.3,
      blendMode = "Translucent",
    },
  }
}

defineSound{
	name = "magma_explosion",
	filename = "assets/samples/monsters/magma_golem_meteor_fall_01.wav",
	loop = false,
	volume = 2.5,
	minDistance = 1,
	maxDistance = 10,
}
I saw the problem with the ocean shader Minmay talked about. It seems after some time the waves are reduced to 0 amplitude. I don't know if the formula is good but I tried to follow the advise in the code commentary of water_surface_calm "compensate this by increasing wave amplitude to unrealistic value..." setting it to a proportion of the time parameter. So the effect seems to continue at least a lot longer now. Also reduced the fog a little and redefined the sound of explosions.