Jump to content

havenphillip

Members
  • Posts

    550
  • Joined

  • Last visited

Everything posted by havenphillip

  1. havenphillip

    Vehicle

    https://steamcommunity.com/sharedfiles/filedetails/?id=345315752&searchtext=
  2. havenphillip

    Vehicle

    I've seen a few vehicle scripts in the workshop. Here's a few: https://steamcommunity.com/sharedfiles/filedetails/?id=1662222417
  3. havenphillip

    Pawn

    Dude how'd you get that reflective gloss on everything? That looks great.
  4. Thanks, dude. You got me started off in the right direction. #version 400 //Ma-Shell + //https://www.shadertoy.com/view/ldsGDn + //https://www.shadertoy.com/view/XdBBzh uniform sampler2D texture1; uniform float currenttime; uniform vec2 buffersize; uniform bool isbackbuffer; uniform mat4 projectioncameramatrix; float time=currenttime/1000.0; out vec4 fragData0; vec2 hash22(vec2 p){ vec2 p2 = fract(p * vec2(.1031,.1030)); p2 += dot(p2, p2.yx+19.19); return fract((p2.x+p2.y)*p2); } #define round(x) floor( (x) + .5 ) vec2 wetGlass(vec2 p) { p += p * 0.1; // distort drops float t = time; p *= vec2(.025, .025 * .25); p.y += t * .25; // make drops fall vec2 rp = round(p); vec2 dropPos = p - rp; vec2 noise = hash22(rp);//randomizes drop placement dropPos.y *= 4.; t = t * noise.y + (noise.x*6.28); vec2 trailPos = vec2(dropPos.x, fract((dropPos.y-t)*2.) * .5 - .25 ); dropPos.y += cos( t + cos(t) ); // make speed vary float trailMask = clamp(dropPos.y*2.5+.5,0.,1.); // hide trail in front of drop float dropSize = dot(dropPos,dropPos); float trailSize = clamp(trailMask*dropPos.y-0.5,0.,1.) + 0.5; trailSize = dot(trailPos,trailPos) * trailSize * trailSize; float drop = clamp(dropSize * -60.+ 3.*noise.y, 0., 1.); float trail = clamp(trailSize * -60.+ .5*noise.y, 0., 1.); trail *= trailMask; // hide trail in front of drop return drop * dropPos + trailPos * trail; } float rain(vec2 uv, float scale, float time) { float w=smoothstep(1.0,0.0,-uv.y*(scale/10.0)); if(w<0.2)return 0.0; uv+=time/scale; uv.y+=time*2.0/scale; uv.x+=sin(uv.y+time*.5)/scale; uv*=scale; vec2 s=floor(uv),f=fract(uv),p; float k=3.0,d; p=.5+.35*sin(11.0*fract(sin((s+scale)*mat2(vec2(7,3),vec2(6,5)))*7.0))-f; d=length(p); k=min(d,k); k=smoothstep(0.003,k,sin(f.x+f.y)*0.01); //particle size sort of return k*w; } void main(void) { vec2 uv=(gl_FragCoord.xy/buffersize); if (isbackbuffer) uv.y = 1.0 - uv.y; vec2 position = ( gl_FragCoord.xy - buffersize.xy* 0.5 ) / buffersize.x; position.y+=projectioncameramatrix[1][3]; position.y-=1.0; float angle = atan(position.y,position.x)/(0.5*3.14159265359); vec4 color = texture(texture1,uv); float c=smoothstep(1.0,0.3,clamp(uv.y*.3+.8,0.0,.75)); c+=rain(uv,20.0*angle,time)*.5; c+=rain(uv-5,15.0*angle,time)*.8; c+=rain(uv+5,10.0*angle,time); c+=rain(uv+7,8.0*angle,time); c+=rain(uv-5,6.0*angle,time); c+=rain(uv,4.0*angle,time); vec3 rainfall=(vec3(c)); uv += wetGlass(gl_FragCoord.xy/1.5); fragData0 = texture(texture1, uv)/1.5+vec4( rainfall.r+color )*.3; }
  5. I guess I should have clarified. I'm thinking in terms of using shaders on the terrain. For instance if I want it to rain and I want the dirt to change colors and gain a cubemap-like glossiness I could theoretically use a shader to do that attached to a material. Using textures is limited in that regard. Seems like it would be useful.
  6. Materials. Not textures. As in complete with the material settings and shaders attached.
  7. Is there some way to add a material to an imported .raw terrain?
  8. Yeah that's cool, man. Thanks. Nice work. I'm getting some big drops though. What line affects the rain size? And how did they get it to splash when it hits the ground?
  9. What is it going to mean for us noobs to switch over to Vulkan? Is that going to change anything in the shader codes or anything?
  10. I did watch that tutorial. It was pretty good. I grabbed that Day/Night shader. I was hoping it had the rain shader attached to it. I found this snow shader online and was able to get it working but I can't figure out how to get rid of the grey background. It works as a PostEffect but pretty much useless thus far. #version 400 uniform float currenttime; uniform vec2 buffersize; float time=currenttime/1000.0; out vec4 fragData0; float snow(vec2 uv, float scale, float time) { float w=smoothstep(1.0,0.0,-uv.y*(scale/10.0));if(w<.1)return 0.0; uv+=time/scale;uv.y+=time*2.0/scale;uv.x+=sin(uv.y+time*.5)/scale; uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.0,d; p=.5+.35*sin(11.0*fract(sin((s+scale)*mat2(vec2(7,3),vec2(6,5)))*5.0))-f;d=length(p);k=min(d,k); k=smoothstep(0.0,k,sin(f.x+f.y)*0.01); return k*w; } void main(void) { vec2 uv=(gl_FragCoord.xy*2.0-buffersize.xy)/min(buffersize.x,buffersize.y); float c=smoothstep(1.0,0.3,clamp(uv.y*.3+.8,0.0,.75)); c+=snow(uv,30.0,time)*.3; c+=snow(uv,20.0,time)*.5; c+=snow(uv,15.0,time)*.8; c+=snow(uv,10.0,time); c+=snow(uv,8.0,time); c+=snow(uv,6.0,time); c+=snow(uv,5.0,time); vec3 finalColor=(vec3(c)); fragData0 = vec4(finalColor,1.0); } //vertex #version 400 uniform mat4 projectionmatrix; uniform mat4 drawmatrix; uniform vec2 offset; uniform vec2 position[4]; uniform float currenttime; in vec3 vertex_position; out float time; void main(void) { gl_Position = projectionmatrix * (drawmatrix * vec4(position[gl_VertexID]+offset, 0.0, 1.0)); }
  11. You don't happen to have Shadmar's shader pack that had rain and day/night cycle do you? or know where I can get it?
  12. Ah ok. What's the one you were talking about earlier that comes with Leadwerks but doesn't look very good? I have the Shadmar shader. But I wanted to compare it to something else so that I can learn shaders. When I look at it it just looks like nonsense to me. I wish there were more tutorials and shader packs I could get my hands on so I could mess with them.
  13. What's the underwater shader about if it doesn't do underwater? I'm talking about the one that is in the Leadwerks shaders. This one: Shaders/Water/underwater.shader
  14. I tried it as a post effect but I just get a black screen. What do you make of that?
  15. How to use the underwater shader? Is it like a post effect or attach it to a box or something?
  16. Is there anything more specific about when they crash? Is it on startup or when they die or does it happen at 14 minutes or something like that?
  17. I put a bunch of crawlers and crawler spawners on my map and then realize later I don't want them chasing me as I'm testing something else. For me it's just a way to toggle them on or off. I noticed if I have a navmesh and then build navmesh again, and cancel it in the middle of the build, the navmesh I have disappears. It's a minor thing but I just figured a toggle would be useful. I'd do it myself but I don't how.
  18. Cool, man. Enjoy it. I think I recall reading you are pretty new. If you haven't checked out Aggror's Project Saturn series on YouTube I would highly recommend. That's where I started two years ago with no prior coding experience. He explains things really well and introduces a lot of the concepts. He shows how to make a health bar, health kit, an inventory system, respawn the player, and a few other things. Plus he's an actual coder and is frequently on here answering questions, and he's always been really patient with me. Josh did a good job making the Leadwerks lua language accessible and once you start to get it you catch on quick.
  19. Also, if you want the ammo.lua script to display the actual count of grenade ammo you have you can fix that in the Fps_GrenadeView.lua script by making use of the comparable variables that script already has. Open Fps_GrenadeView.lua Add this (change this) under the Start() function: self.clipammo = self.GrenadeAmmo self.clipsize = self.MaxGrenades self.ammo = self.MaxGrenades In the Fire() function under "self.GrenadeAmmo = self.GrenadeAmmo - 1" add this: self.clipammo = self.clipammo - 1 Like this:
  20. Yeah. It was freezing up on me, too. I have a fix. Just for fun I was working on it last night. It has to do with a line in the FPS_Grenade.lua script. Open the FPS_Grenade.lua script right next to the other script. Go down to about line 480 and look for "self.entity:Release()" Uncomment it or change it to "self.entity:Hide()" Then, just under that write: if self.entity:Hide() then self.entity:Release() end Like this:
  21. It's because the grenade weapon doesn't have a "clip" variable. One thing you could try is adding these in the Start() function of the Fps_GrenadeView.lua script. That will get you past that error: self.clipammo = 1 self.clipsize = 1 self.ammo = 1 Basically the ammo script is trying to figure out what numbers to display. It's asking the pipebomb script "How much ammo do I display?" and the pipebomb script is like "I don't know what you're talking about. I've never heard of clip, or clipsize, or clipammo, etc." So you have to add the variables in the pipebomb script so it can tell the ammo.lua PostRender() what to display. I used "1" which is completely arbitrary. The next thing will be to figure out how to get the pipebomb to count down as you chuck grenades.
  22. Is it possible that I had pivots in front of my player? I never figured it out. I could just stand still and shoot and it would hit me. I did move some pivots and restarted Leadwerks and it seems to have resolved.
  23. Do you have enabled set to True on the ones that aren't working?
  24. I didn't know that feature was there. It doesn't disable the navmesh, though.
×
×
  • Create New...