Jump to content

Waterplane in Editor


Marleys Ghost
 Share

Recommended Posts

Anyone else having this trouble, when going "under" water in the editor the screen just goes grey? Is there something that now needs to be set instead of just going with the default settings? This is a fresh full install of the SDK as of this morning.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

No just a small lag until I get the underwater effects.

Maybe you have to set the fog distance/color located in waterplane properties.

 

when is the last time you sync'ed Michael? because I sync'ed last night and I have the same problem as MG

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

No just a small lag until I get the underwater effects.

Maybe you have to set the fog distance/color located in waterplane properties.

 

 

No I had the small lag in the older version of 2.3 .. but this is a fresh full install and all I get when submerged is a grey screen .. this is leaving (as usual) the waterplanes default settings. I don't think I have ever used anything but the submerged defaults.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

when is the last time you sync'ed Michael? because I sync'ed last night and I have the same problem as MG

 

 

Atleast I know its not just me, thanks Mack. :lol:

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Found the issue... for some reason the scripts/math/vector.lua script was screwed up...

 

In the StringToVec2 function, this line:

return Vec2(x,y,z)

needs to be changed to this:

return Vec2(x,y)

 

and this allows the underwater to be seen correctly in the editor... still working on what the issue is outside of the editor

 

ok... along with that, it still seems something is amiss with Vec2's in LE. I ran some old bmax code that actually set the water properties and it started failing at the framewOrk Vec2's... This code worked just fine the last time I ran it. To get this to work again, I had to use the components of the Vec2...

 

Also, even with the above change to the vector.lua script, I forgot that I had to also change the waterplane script.

Inside the Refresh function, this line:

fw.renderer:SetWaterVisibility(self.visibility)

needs to be changed to this:

fw.renderer:SetWaterVisibility(self.visibility.x, self.visibility.y)

 

Whats going on with the VEC2's in LE?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Whats going on with the VEC2's in LE?

Nothing. A lot of the Vec2 arguments in the framework commands were redundant, because you would never have those values as Vec2's in the first place, unlike colors and positions, which often already come in a vector object. The parameters are all documented here:

http://leadwerks.com/wiki/index.php?title=Framework

 

If you do not want to mess around with this, just use the existing framewerk module, which will work fine.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Nothing. A lot of the Vec2 arguments in the framework commands were redundant, because you would never have those values as Vec2's in the first place, unlike colors and positions, which often already come in a vector object. The parameters are all documented here:

http://leadwerks.com/wiki/index.php?title=Framework

 

If you do not want to mess around with this, just use the existing framewerk module, which will work fine.

 

ok... so apparently there are differences between framewOrk and framewErk. I have no problems with the change except the fact that it wasn't announced. And it seems pointless now to use the framewErk module, since its not going to be updated.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

I made a small fix to the waterplane script and uploaded. The SetWaterVisibility arguments were wrong:

require("scripts/class")

local class=CreateClass(...)

function class:InitDialog(grid)
self.super:InitDialog(grid)
local group=grid:AddGroup("Water")
group:AddProperty("submersioncolor",PROPERTY_COLOR,"","Submersion Color")
group:AddProperty("Softness",PROPERTY_FLOAT,"0,50")
group:AddProperty("Visibility",PROPERTY_VEC2)
group:AddProperty("Amplitude",PROPERTY_FLOAT,"0,16")
group:AddProperty("WaveSpeed",PROPERTY_FLOAT,"0,10","Wave speed")
group:Expand(1)	
end

function class:CreateObject(model)
local object=self.super:CreateObject(model)
object.height=model.mat.ty

object.submersioncolor=Vec4(0.5,0.5,0.5,1.0)
object.softness=1
object.visibility=Vec2(0,20)
object.amplitude=1
object.wavespeed=1

object.model:SetKey("submersioncolor","128,128,128,255")
object.model:SetKey("softness","1.0")
object.model:SetKey("visibility","0,20")
object.model:SetKey("amplitude","1.0")
object.model:SetKey("wavespeed","1.0")

function object:Refresh()
	if fw~=nil then
		fw.renderer:SetWater(1)
		fw.renderer:SetWaterHeight(self.height)
		fw.renderer:SetWaterColor(self.model.color,self.submersioncolor)
		fw.renderer:SetWaterSoftness(self.softness)
		fw.renderer:SetWaterVisibility(self.visibility.x,self.visibility.y)
		fw.renderer:SetWaterAmplitude(self.amplitude)	
		fw.renderer:SetWaterWaveSpeed(self.wavespeed)		
	end
end

function object:UpdateMatrix()
	self.height=self.model.mat.ty
	self:Refresh()
end

function object:UnlockKeys(model)
	object:Refresh()
end

function object:SetKey(key,value)
	if key=="softness" then
		self.softness=tonumber(value)
	elseif key=="submersioncolor" then
		self.submersioncolor=StringToColor(value)
	elseif key=="visibility" then
		self.visibility=StringToVec2(value)
	elseif key=="wavespeed" then
		self.wavespeed=tonumber(value)
	elseif key=="amplitude" then
		self.amplitude=tonumber(value)
	elseif key=="position" then
		local t
		t=StringToVec3(value)
		self.height=t.y
		return self.super:SetKey(key,value)
	else
		return self.super:SetKey(key,value)
	end
	return 1
end

function object:Free()
	local model,object
	self.class:RestoreDefaults()
	for model,object in pairs(self.class.instances) do
		if object~=self then
			object:Refresh()
			break
		end
	end
	self.super:Free()
end

object:Refresh()
end

function class:RestoreDefaults()
if fw~=nil then
	fw.renderer:SetWater(0)
	fw.renderer:SetWaterHeight(0.0)
	fw.renderer:SetWaterColor(Vec4(1,1,1,1),Vec4(0.5,0.5,0.5,1.0))
	fw.renderer:SetWaterSoftness(1.0)
	fw.renderer:SetWaterVisibility(Vec2(0,50))
	fw.renderer:SetWaterAmplitude(1.0)
	fw.renderer:SetWaterWaveSpeed(1.0)
end
if fw.renderer.waterpatch~=nil then
	fw.renderer.waterpatch:SetParent(nil,1)
end	
end

function class:Free()
self:RestoreDefaults()
self.super:Free()
end

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

It will take you a few seconds to change those vec2 range parameters to floats. I agree it is annoying, but I made the change with the approach of "what will result in a better engine six months from now?".

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

that looks familiar! ;)

 

also did you fix the vector.lua script as well?

 

also, the RestoreDefaults function for the visibility is wrong... you are still calling a Vec2?

 

ok.. i think i see whats happening... you are setting values that have to two components as Vec2's but the framewOrk items that used to use Vec2's are now using floats? wait... what? :rolleyes:

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Great .. I went down the Pub... I knew after a few beers the answer would present itself :rolleyes:

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Guest Red Ocktober

ok... now some real waves... pleeeeeeeezzzz...

 

or at least clue me into how i can access some vertices to make some simple waves on the cpu...

 

sorry to be such a pain about this... but i really need it for a naval game/sim that takes place in nothing but water...

 

 

--Mike

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...