Jump to content

Recommended Posts

Posted

Try this for the firepit script and it will work:

require("scripts/class")

local class=CreateClass(...)
class.sound=LoadSound('abstract::campfire_01_15.wav')

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

object.model.aabb.x0=-5
object.model.aabb.x1=5
object.model.aabb.y0=-5
object.model.aabb.y1=5
object.model.aabb.z0=-5
object.model.aabb.z1=5

--Create light
object.light=CreatePointLight(4,model)
object.light:SetColorf(1,0.6,0.25,1,1)
object.light:SetPositionf(0,1.2,0,0)
object.light:SetShadowOffset(0,0.91,0)

--Create emitters
if fw~=nil then
	SetWorld(fw.transparency.world)

	object.heathaze=CreateEmitter(10,4500,Vec3(0,1,0),0,object.model)
	object.heathaze:SetPositionf(-136,52,-662,0)
	object.material_heathaze=LoadMaterial('abstract::heathaze.mat',0)
	object.heathaze:Paint(object.material_heathaze,0)
	object.heathaze:SetRadius(0.25,0.25)
	object.heathaze:SetWaver(0)
	object.heathaze:SetOrder(1,0)
	object.heathaze:SetVelocity(Vec3(0,0.375,0),Vec3(0,0.05,0))
	object.heathaze:SetRotationSpeed(0.01)
	object.heathaze:SetArea(Vec3(0.2,0.0,0.2))
	object.heathaze:SetPositionf(0,0.25,0,0)

	object.fire=CreateEmitter(25,750,Vec3(0,1,0),0,object.model)
	object.fire:SetPositionf(0,0.25,0,0)
	object.fire:Paint(LoadMaterial('abstract::fire.mat'),0)
	object.fire:SetRadius(0.4,0.1)
	object.fire:SetColorf(0.2,0.2,0.2,1,1)
	object.fire:SetWaver(1)
	object.fire:SetVelocity(Vec3(0,1.5,0),Vec3(0,0.05,0))
	object.fire:SetRotationSpeed(0.01)
	object.fire:SetArea(Vec3(0.2,0.1,0.2))

	object.sparks=CreateEmitter(5,800,Vec3(0,1,0),0,object.model)
	object.sparks:Paint(LoadMaterial('abstract::fire.mat'),0)
	object.sparks:SetRadius(0.01,0.01)
	object.sparks:SetColorf(1,0.6,0.25,1,1)
	object.sparks:SetVelocity(Vec3(0,1.5,0),Vec3(0.05,0.5,0.05))
	object.sparks:SetRotationSpeed(0.1)
	object.sparks:SetArea(Vec3(0.4,0.0,0.4))
	object.sparks:SetWaver(5)
	object.sparks:SetPositionf(0,0.25,0,0)

	SetWorld(fw.main.world)
end

--Emit fire sound
if class.sound~=nil then object.model:EmitSound(class.sound,10,1,1) end

--Declare initial values
object.fluctuation=1.0
object.smoothedfluctuation=1.0

function object:SetKey(key,value)
	if key=="color" then
	elseif key=="intensity" then
	else
		return self.super:SetKey(model,key,value)
	end
	return 1
end

--Force the bounding box to be bigger
--[[function object:UpdateMatrix()
	object.model.aabb.x0=object.model.mat.tx-5
	object.model.aabb.x1=object.model.mat.tx+5
	object.model.aabb.y0=object.model.mat.ty-5
	object.model.aabb.y1=object.model.mat.ty+5
	object.model.aabb.z0=object.model.mat.tz-5
	object.model.aabb.z1=object.model.mat.tz+5
	object.model.aabb:Update()
end]]--

function object:GetKey(key,value)
	if key=="color" then
	elseif key=="intensity" then
	else
		return self.super:GetKey(model,key,value)
	end
	return value
end

function object:Render()
	self.fluctuation=self.fluctuation+math.random(-100,100)/1000.0*AppSpeed()
	self.fluctuation=math.min(1.8,self.fluctuation)
	self.fluctuation=math.max(0.2,self.fluctuation)
	self.smoothedfluctuation=Curve(self.fluctuation,self.smoothedfluctuation,5.0/AppSpeed())
	self.light:SetColorf(1.0*self.smoothedfluctuation,0.6*self.smoothedfluctuation,0.25*self.smoothedfluctuation,1,0)
end

end

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

Posted

why does your SetKey and GetKey functions have three parameters?

return self.super:SetKey(model,key,value)

 

return self.super:GetKey(model,key,value)

 

shouldn't it only be two parameters, key and value?

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

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted

also now, the heat haze from the firepit doesn't appear to be rendering correctly in bmax. Looks fine in the editor but wrong in the program...

 

edit--- the forum won't allow me to attach a 15kb pic...

 

newfirepitissue.jpg

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

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted

Just updated... No heathaze in the Editor or Lua, sky is default though I changed it in the Editor.

AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64.

Posted

Can you post a demo? I did a test in C++ and it worked fine. Shouldn't be any difference.

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

Posted

I still get the problem with water and the heat haze in the editor and in Bmax.Not had the same effect as Mack though.

 

post-12-12623912345884_thumb.jpg

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"

Posted

For me firepit particle works now ! thanks :blink:

 

i also get marléy's heat haze issue with water, but it's wysiwyg and exactlty the same in the editor and outside.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Posted

yeah the heathaze issue with water is a known issue... its in the bug tracker... basically don't mix emitters with water...

 

my problem was i was getting that with no water in my scene... i am trying to do a clean install in hopes that it magically fixes the issue :blink:

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

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted

I had/still have this issue with the heathaze.

 

 

I also would like to note that any of the particle shaders that use refraction will not be visible if there are other particles being rendered behind them.

 

It seems that particles don't play nicely with each other.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Posted

That's normal. Unless you want a separate buffer/pass for every single z-sorted object, it's not possible to have refraction on top of refraction. All particles are rendered in the same pass, even if they aren't using a refraction effect.

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

Posted

Well, I am not rendering refraction on top of refraction.

 

I am rendering refracting particles on top of normal fog / smoke particles.

 

Refraction on Normal Particles should work...

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Posted

Why exactly?

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Posted

Because the refraction shader reads a texture to refract what has already been rendered. Rasterizers can't read an underlying pixel, unfortunately.

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

Posted

Ah, that makes sense then.

 

The first thing that came to mind when this reared its head was more than one transparency world, but probably not.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Posted

Well, it won't stop there. Then we will need one for water, one for emitters, one for refractive materials...and then someone will notice two refractive layers don't work.

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

Posted

How do most games get around this then?

 

It isn't impossible, because you can see it has been done in games:

- Windows

- Water

- Rain

- Emitters

- Other Glass

 

We will stumble upon a way to do it eventually, and it isn't anything super important. I am happy with the fact we have robust particles at all.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Posted

You CAN have layers of transparent surfaces, just not when they use a refraction effect that reads from a texture and distorts the image.

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

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.

×
×
  • Create New...