havenphillip Posted May 15, 2020 Author Share Posted May 15, 2020 Maybe a better explanation: I overlayed the two images so you can see it's all inside the geometry. The space you can see between the red line and the yellow line are actually repetitions of the texture which you can only see because the parallax "sinks in" the texture. You're actually seeing beyond the boundary of the quad. So all I'm cutting are those (infinite, I presume) repetitions of the texture that wouldn't normally be seen anyway. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted May 15, 2020 Share Posted May 15, 2020 Does it work with arbitrary geometry or are cubes a special case? Quote 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 More sharing options...
havenphillip Posted May 15, 2020 Author Share Posted May 15, 2020 I've made it work on squares and rectangles but it's best for planes, like if you have a wall segment and want to spice it up you could do that, but put some pillars on either side. I tried it on a beveled cube but the smoothing breaks the parallax, and I made a wall that had a diagonal 45 degree angle and it couldn't make sense of the angle as I walked past it. It did the same with the parallax shader included with Leadwerks, so I figure that has to do with the TBN matrix. It doesn't like diagonals. Besides that, the cutting system I have is horrible because you have to reset it manually for each shape. I currently have to select the brush, click "Select Face" and then center it. Then I have to unhide the alpha square and adjust the size of it, and you have to get those numbers almost perfect or you go too far and don't cut enough and get gaps, or cut too much and lose the effect. So my problems are the cutting system, the sharp lines along the edges nearest the camera, and the FPS cost. I'd like to get it to a point where it works to maybe round the edges of the quad in the shader and generally solve the edge problems. I'm not that good though so it may take me awhile. Quote Link to comment Share on other sites More sharing options...
havenphillip Posted May 15, 2020 Author Share Posted May 15, 2020 Here it is on the sphere. You can see it only works where you cut the texture: 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted May 15, 2020 Share Posted May 15, 2020 That's still pretty neat. I never thought of doing that. 1 Quote 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 More sharing options...
havenphillip Posted October 10, 2020 Author Share Posted October 10, 2020 Here's a terrain model with a pixel depth offset shader with trails. I managed to figure out how to keep it from looking like things are slipping over the parallaxed surface so now you can put stuff on it. It's a little temperamental still. It doesn't like horizontal intersecting (shifts a bit. Not sure how to fix that) and the effect deteriorates with distance (which I think I can fix). But I figured out that you can get this thing quite a bit faster by shrinking all the textures except the diffuse since the parallax effect and diffuse do most of the work on realism, and I got it working on smoothed lumpy surfaces such as hills, etc. You can make your own trail pattern with a texture and use whatever trail diffuse you want and adjust the size and blend and other things. I added a bunch of variables to the shader to fiddle with so you can highly customize it or just mess with it. Notes: Put the included material on the terrain model (6 textures. The texture order is rocky soil diffuse, rocky soil normal, rocky soil smooth, rocky soil height, trails, hardpack diffuse, hardpack normal). Disable "Cast Shadows" on the material. Make sure the model has physics. I use poly mesh. Put the model in the scene and set the scale to 12*12*12 (temperamental. This is the size for the model the shader is set to work with) Put stuff on it so you can see the pixel offset effect. parallax_pixel_depth_offset.zip 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.