-
Posts
550 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by havenphillip
-
-
That's possible. I don't know how to do it. But I guess you could write the waves in the script. Just a sin wave on the surface. If we could do that we'd have wave height.
Macklebee did something like that:
-
Randomly generated? That's crazy. It totally feels natural.
- 1
-
Ok I got it working. No script needed. Just slap it on an object. Works with posteffects now and no crazy watermode acrobatics. It's a repurpose of the Leadwerks soft particle shader.
I set the material settings to blend mode:Alpha, uncheck cast shadows, check two-sided, check depth test, uncheck depth mask, check z-sort, check pick mode.
- 5
-
Yeah I'm just stockpiling right now. I have a bunch of shaders I'll put out in a while. I don't think it will matter that much since I think everyone's moved on from LE4. I get the benefit of having put in the effort, though.
-
That's ok, man. I got the soft particle thing and the forcefield working using this method. The problem I was having was because I had other shaders in my scene using texture4 for something other than depth. They work perfectly now. I don't know why Josh wouldn't just set up a "depth mode" as a permanent thing so that people could use depth buffers for cool stuff. Leadwerks' aversion to shaders is self-defeating, imo.
- 1
-
I made this forcefield shader using the watermode depth buffer which works great. I replaced the Leadwerks water shader with this dummy shader:
//fragment
#version 400
//Uniforms
uniform sampler2D texture4;// depthvoid main(void)
{
float depth = textureProj(texture4,vec3(1)).r;
}//vertex
#version 400
#define MAX_INSTANCES 256void main()
{}
... and I used this script to turn on watermode and set the waterplane height:
function Script:Start()
world = World:GetCurrent()
world:SetWaterMode(true)
world:SetWaterQuality(1)
endfunction Script:UpdatePhysics()
world:SetWaterHeight(3.0)
end... everything works great and the shader works with post effects, which is something I couldn't get accomplished before, AND I'm getting excellent FPS. The problem is I lose the effect as soon as the water plane goes off camera. So I'm thinking if there is a way to create a "depth mode" which keeps the (invisible) water plane on camera at all times that would open up a nice little corner for using the depth buffer for things like a forcefield, water foam, water fog, ground fog, and soft particle falloff effects such as seen here:
http://blog.wolfire.com/2010/04/Soft-Particles
- 2
-
That's ok. I"m not a shader expert either. I appreciate you taking a stab at it. It would be nice to solve it just because it irritates me to find this apparent limitation. I'm hoping someone will read this and be able to tell me at least why it happens.
It seems if I set the player (camera) in the scene then create the depth buffer object I can get away with putting the camera variable in the Start() function. But when I turn the player's head the depth buffer wobbles around in odd ways. If I remove the player and put him back in the scene, the depth buffer stops moving around but I then have to grab the camera in the UpdateWorld() function. I don't know if that has to do with the problem and might offer a clue, or if it's just a whole other problem.
-
No one? Is this thing on?
-
I don't know what it was. I went in offline mode on Steam and I closed Rainmeter. It told me the .werk file for my project was missing. That happens sometimes. Started a new project and now it seems to be working just fine. I'm not tech savvy so if you highly suspect Rainmeter it's probably that, as far as I'm concerned.
-
So this works but it eats up the FPS constantly loading and deleting the shader. Bloom effect brought me all the way down to a constant 7 FPS. Not sure exactly why this works but there's got to be a better way. Anyone?
function Script:UpdateWorld()
self.world = World:GetCurrent()
if self.camera==nil then
for i=0,self.world:CountEntities()-1 do
if self.world:GetEntity(i):GetClass()==Object.CameraClass then
self.camera=self.world:GetEntity(i)
tolua.cast(self.camera,"Camera")
return
end
end
end
depthbuffer:Clear()
depthbuffer:Enable()
self.camera:ClearPostEffects() <---
world:Render()
depthbuffer:Disable()
self.camera:AddPostEffect("Shaders/PostEffects/bloom.lua") <---
Context:SetCurrent(context)
end -
That's what I did. I loaded your null shader. Same results as other posteffect shaders. No line. It's the depth from the Leadwerks water shader, which works while there are posteffects running from what I can tell. So it seems to me there is something that is enabled or present somewhere in water mode that I'm not aware of .
-
You know what I actually saw your post and tried the null shader. I get nothin. What do you mean by "final result"? I don't even know where to start digging for answers.
-
-
-
Ah ok! Thanks, man. Good to know.
-
That happens to me sometimes where a project will just disappear. It won't run so I have to start a new project and copy/paste all the files from the old one. Maybe that's the actual "bug."
-
Ok I restarted my computer, went into offline mode on Steam, closed Rainmeter. Started Leadwerks. It said the project file .werk was missing. Started a new project and now it seems to be working. Didn't see any recent updates but then again I'm not entirely sure what I'm looking for. So it must be one of those things.
-
That could be. What do I do about that?
-
Another thing that's happening is when I run the game the output says "Executing C:\Users\Owner\...." but nothing else. No warnings or errors occur. The game runs. And then when I go to shut the script editor it tells me an external process is still running and asks if I want to terminate it. All this is new.
-
Nope. Nothing.
-
Uninstalled reinstalled. No change. I'll keep messing with things and let you know if it gets fixed.
-
When I run the game the output says Executing...exe and then nothing. I can run it but something is off. If I close the Script Editor it says "An external process is still running. Do you want to terminate it? Seems like I started putting the perspective view in realtime render then moving it around and then like the next day all this.
-
Nothing that I'm aware of. It just started suddenly a few days ago. I'll try an uninstall reinstall see if that does it.
-
No mouse. I'm on a laptop. I can zoom in and out that's it. I don't know what I might have done. I also can't run in debug mode.
Find a vertex from global position
in Programming
Posted
Here's the post where he shows the script. I copied it down: