Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

233 Excellent

1 Follower

Profile Information

  • Gender

Recent Profile Visitors

1,969 profile views
  1. Note: In my last post shaders 36 and 37 weren't working correctly so I replaced them. If you got the old ones you can throw those out and re-download the new ones on the same links. These shaders are based on the Leadwerks soft particle shader, which I was directed to by Marcousik, and which I noobalyzed into a model shader. What the soft particle shader does is create a soft falloff in opacity depending on how close objects are behind it. To clarify, imagine looking down at a water plane, and a terrain beneath it. Depending on how far away the terrain is from the water plane determines
  2. Simplistically speaking, you could think of the vertex stage of a shader as the "position" of the object, and the fragment stage as the "color." All you really need is position and color. Vertex displacement manipulates the position to warp or move the object. There are many ways to do it but the whole trick revolves around the ex_vertexposition. You may notice in every model shader you have these two lines in the vertex stage: ex_vertexposition = entitymatrix_ * vec4(vertex_position,1.0); gl_Position = projectioncameramatrix * ex_vertexposition; I know from things
  3. I think so. I set the mask size to 0.1 and I don't think I'm seeing any repetition. At ground level it looks good. The textures themselves repeat.
  4. I don't deal with noise shaders that much but there are a lot of examples on Shadertoy. It has a lot of uses depending on what you want, but very often I see noise being used with raymarching to create 3D scenes. I prefer using textures because I can get what I want out of them and noise is a lot of math (noise shaders can get very large very quickly), but I figured a good shader series ought to have a noise function somewhere. I got this noise from iq of Shadertoy fame. Just a nice little simplex noise: 30_noise.zip You can make a mask out of your noise and
  5. havenphillip


    Parallax is a cheap way to add a lot of 3D details to any scene. The less vertices on a mesh the better, because parallax doesn't actually add any geometric information. And it requires only the bare minimum number of vertices to work. That makes it fast. And the effect is believable. All you really need is a heightmap and a dream... It's a lot of fun trying different textures with it, and if I could I'd use it for everything. However, there are a few limitations to parallax. The first problem you run into is that it has trouble with the curve. It works best on a flat plane or a slightly
  6. Masking is pretty easy and useful for adding some variety to your shaders. Masks are usually just some greyscale image that is turned into a float. In shaders floats have a very broad utility because you can add them just about anywhere. Super useful. And they can be used to blend textures or define areas in your material. Adding a mask in code is the same as with any texture. The greyscale quality allows you to use a single channel of that greyscale as a representative of all the channels. For instance the red channel. In code it looks something like: float mask = texture(texture5,e
  7. havenphillip


    One of those things I wanted to make - and a big reason I think many people get involved in shaders - is water. If you've been following along and grabbing these shaders you have now almost all the parts you need to make a basic water plane. If you understand these parts then you can manipulate them to customize your water as you see fit. I'm going to spend a little time in explanation here. In making this shader I start with the base shader and add a texture scroll effect on the normals (02_texture scroll). I then duplicate this texture and scroll it in the opposite direction to give th
  8. It's cube mapping https://adventuresinrendering.wordpress.com/2014/02/06/texture-mapping-and-image-based-lighting/
  9. Another simple shader technique is the skybox (or cubemap) reflection. Cubemaps are useful for creating quick and easy reflective surfaces for objects and work particularly well on curved surfaces or objects with bumpy normals. You can create an impression of a metallic, wet, or polished look quite easily (provided you have a way to generate cubemaps). In code, they are about as easy as fresnel, which gives them something of a broad utiity. Once you have the technique, you can treat it as a "part" to add to other shaders. Here's the cubemap section in the shader: vec3 eyevec = no
  10. That's great how you just did the math on that and made it work. Would be cool to set an invisble texture on the terrain and then pick the terrain to make obects float above it at the water level. Would a terrain pick capture the wave height? It's going to be cool to see stuff floating on this.
  11. Here's the post where he shows the script. I copied it down: window = Window:Create("terrain example",0,0,800,600,Window.Titlebar+Window.Center) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:SetPosition(0,5,-5) camera:SetMultisampleMode(8) skybox = Texture:Load("Materials/Sky/skybox_texture.tex") camera:SetSkybox(skybox) light = DirectionalLight:Create() light:SetRotation(35,35,0) terrain = Terrain:Create(64,true) terrain:SetLayerTexture(0, Texture:Load("Materials/Developer/Bluegrid.tex"), 0) terrain:SetScale(1,100,1) ball = Model:
  12. 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:
  13. If you took a bowl full of water and looked straight down into the bowl, the water would be clear. But if you were to then move the bowl up to your eye and look from the side along the surface of the water, you'd see it becomes highly reflective. That's fresnel. It's a cool effect. And it's easy to code. You add a uniform vec3 cameraposition towards the top and a fresnel color, and then a fresnel effect is little more than this: vec3 eyevec = normalize(cameraposition - ex_vertexposition.xyz); float ndotv = dot(normal,eyevec); After that all you need to do is output it
  14. Leadwerks 4 is one of the best purchases I've ever made. I've spent thousands of hours on it and most of that time has been spent dinking around with shaders. I'm not great at modeling and animation. I'm ok with scripts. What seems to draw me the most is shaders. I love shaders. I guess in some way here I just want a place to show off my accomplishments, but I also want to feel like I benefit other people, so my philosophy here is that it's cool to be one guy who can write shaders, but it's cooler to be one guy who can help several other guys write shaders. So I had this idea that I would atte
  • Create New...