Marcousik Posted January 19, 2022 Share Posted January 19, 2022 6 hours ago, Yue said: the ground must be of many triangles so that the effect is much more pleasing. Yes I did build such a mesh but the triangles are not bound each other and it results a hole. You can't think - as I did - that the mesh will react like a terrain forming, with each segment moving the next with itself, going up and down as you expect., building a beautiful hill. No. Mesh is composed of lots of triangle but moving one vertex open a window in the mesh, - so practically you will have to calculate with this method the interpolated positions of all neighbor vertex to simulate properly a beautiful wave. If not your mesh will only looks messy 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted January 23, 2022 Share Posted January 23, 2022 I'm already thinking about the footprints my character will leave on the Martian terrain. Quote Link to comment Share on other sites More sharing options...
havenphillip Posted February 13, 2022 Author Share Posted February 13, 2022 Ok so I was able to make this simple painter using a Shadertoy shader. Just put a pivot in a new scene and attach the script to it. The problem I have is when I try to switch the shader over to a model shader, and I change the line in the shader from: if(length((coord*buffersize) - mouse_pos.xy) > radius) discard; ...to this: if(length(ex_vertexposition.xy - cameraposition.xy) > radius) discard; ...and change these updateworld lines also in the script to this: function Script:UpdateWorld() mouse = self.entity:GetPosition(true) self.shader:SetVec3("cameraposition", mouse) end ...I end up with a dot that follows the camera around but it stops leaving trails. I don't understand what I'm losing in the process. Why is that happening? painter.zip Quote Link to comment Share on other sites More sharing options...
havenphillip Posted February 13, 2022 Author Share Posted February 13, 2022 Here's the model version: -- create box and attach painter model material to it -- create camera in scene and attach spectator script to it so you can fly around -- create pivot and child it to camera, and attach this script to it painter model.zip Quote Link to comment Share on other sites More sharing options...
Marcousik Posted February 18, 2022 Share Posted February 18, 2022 Hey Havenphillip, I have a question would you have an idea how to make that: It 's like a normal without diffuse texture? Is this possible? Thx (using decals) Quote Link to comment Share on other sites More sharing options...
havenphillip Posted February 19, 2022 Author Share Posted February 19, 2022 Yeah you totally can. It's just a matter of changing the alpha value of the diffuse texture in the diffuse + normal decal shader. Try this shader on your decal material: decal alpha + normal.zip I changed only three lines: //Alpha fragData0.a = 0.0; //was probably 1.0 fragData1.a = 1.0; //was fragData0.a; ... was set to the alpha of the diffuse so when you set diffuse alpha to zero it also set normal alpha to zero fragData2 = vec4(vec3(0),1.0); //the alpha channel was fragData0.a I also normalized the ex_tangent, ex_binormal, and ex_normal. Here I just tried it with the bulletmark decal material. Only the normals show up. No diffuse: Also I have the material set like this (not sure how much "pick mode" or "z-sort" matter): 2 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted February 20, 2022 Author Share Posted February 20, 2022 I updated and re-uploaded the above shader. I tried it on the tracks and was getting a bad result. It looks right now. Before and after: 2 1 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted February 21, 2022 Share Posted February 21, 2022 That looks so nice ? Quote Link to comment Share on other sites More sharing options...
Marcousik Posted June 10, 2022 Share Posted June 10, 2022 @havenphillip Hi, I tried today to get that work but sorry I'm a terrible zero with shader. So I just did not get the traces to work as expected. No matter if I use one or the second shader that comes with the download. You put in the download height.tex and height2.tex, should i use one of them in the material ? Where? Maybe you could just post a little screenshot of your material textures view, thx a lot Edit Got it to work, using tire_height.tex in the displacement slot and the "decal alpha + normal.shader" the effect is really cool, will be useful for foot steps too I think! 2 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted June 10, 2022 Author Share Posted June 10, 2022 Yeah sorry I didn't clarify. I added a normals from heightmap part to it to get an extra boost on the groove of the tread. I think if you don't want the heightmap used you can hide this line: normal = mix(heightnormal,normal,0.5); ...and remove the whole "normals from heightmap" section and it should work fine if you have a dramatic normal map. 2 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted June 14, 2022 Share Posted June 14, 2022 I am working on an example of this in Ultra. https://www.ultraengine.com/learn/Terrain_SetElevation?lang=cpp 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...
Josh Posted June 16, 2022 Share Posted June 16, 2022 Finished example: https://www.ultraengine.com/learn/Terrain_SetMaterial?lang=cpp 3 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...
Marcousik Posted June 17, 2022 Share Posted June 17, 2022 Will you put the feature road tracer ? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 17, 2022 Share Posted June 17, 2022 13 minutes ago, Marcousik said: Will you put the feature road tracer ? Yeah, I was thinking I could create a bezier curve and turn that into a series of decals that form the road. This will come after the 1.0 release. 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...
Josh Posted June 17, 2022 Share Posted June 17, 2022 More information here: 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...
Josh Posted June 19, 2022 Share Posted June 19, 2022 Terrain sculpting example finished: https://www.ultraengine.com/learn/Terrain_SetElevation?lang=cpp 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...
Marcousik Posted June 20, 2022 Share Posted June 20, 2022 On 6/17/2022 at 12:19 PM, Josh said: Yeah, I was thinking I could create a bezier curve and turn that into a series of decals that form the road. This will come after the 1.0 release. Yes something like a spline tool is a must.. But we should see the spline from the editor, that's the main feature I miss by Aggror Spline system Quote Link to comment Share on other sites More sharing options...
Josh Posted June 20, 2022 Share Posted June 20, 2022 Actually, I take that back. It should be done with meshes blended into the terrain, not decals. The way Epic is doing this is ridiculous. I thought of a method that will be much simpler and more efficient. 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...
Marcousik Posted March 31, 2023 Share Posted March 31, 2023 @havenphillip and @ all interested in this On this topic on how to perform or animate traces on terrain especially water, mud or foot step, I worked on a your shader havenphilip And here is what I obtain, playing with variables and shader equations: And here is the shader Now the stuppid thing that I don't understand is : I set the wind effect with the condition if (vertex_position.y > 100.1) I actually used this to stop the wind effect to be seen, but/so why I can't just erase this wind? Because if I erase the wind, the shader becaomes just mess ! I just don't understand why?? 1 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted March 31, 2023 Author Share Posted March 31, 2023 You should be able to just erase these lines without any problem. It doesn't look like you're establishing anything here that you need to use later: Quote Link to comment Share on other sites More sharing options...
Marcousik Posted April 1, 2023 Share Posted April 1, 2023 20 hours ago, havenphillip said: You should be able to just erase these lines without any problem. It doesn't look like you're establishing anything here that you need to use later: Yes that sounds logical. But without those "wind" lines, the shader is not perfect, it breaks by rotating the camera, at some point, some of the mesh springs out and flickers. Adding those lines solve the flickers 100% ! This is not a big issue but I can't understand why. It is much more crazy; this is the difference by just changing a number of the wind line: I set a 2 instead of 4, it is immediatly broken: with a 4, it is perfect INcredible, somethinng is wrong but Idk what Quote Link to comment Share on other sites More sharing options...
havenphillip Posted April 2, 2023 Author Share Posted April 2, 2023 I tried to reproduce it. I'm not getting the same outcome. It seems to be working correctly for me: When you zoom in and out on the object does it adjust itself? If it works correctly in-game then it might just be the material editor or have something to do with using the "player_pos". Otherwise sometimes I've noticed if I restart my computer it will fix some of these weird things. Does this work?: #version 400 #define MAX_INSTANCES 256 //Uniforms uniform instancematrices { mat4 matrix[MAX_INSTANCES];} entity; uniform mat4 projectioncameramatrix; uniform float currenttime; float time = currenttime/1000; uniform vec3 cameraposition; uniform vec3 player_pos; //Attributes in vec3 vertex_position; in vec2 vertex_texcoords0; in vec3 vertex_normal; in vec3 vertex_tangent; in vec3 vertex_binormal; //Outputs out vec4 ex_vertexposition; out vec2 ex_texcoords0; out vec3 ex_normal; out vec3 ex_tangent; out vec3 ex_binormal; void main() { //entity matrix mat4 entitymatrix = entity.matrix[gl_InstanceID]; mat4 entitymatrix_ = entitymatrix; entitymatrix_[0][3]=0.0; entitymatrix_[1][3]=0.0; entitymatrix_[2][3]=0.0; entitymatrix_[3][3]=1.0; //model position ex_vertexposition = entitymatrix_ * vec4(vertex_position,1.0); //Interactive vec3 direction = normalize(ex_vertexposition.xyz - player_pos); direction.y = -0.000; float radius = 2.0; float interact_power = 2.0; float dist = distance(player_pos,ex_vertexposition.xyz); float power = smoothstep(radius,0.0,dist*dist*0.3); direction = (vec4(direction,1.0) * entitymatrix_).xyz; ex_vertexposition.xyz += direction * power * 5.0 * interact_power * cos(5.0-ex_texcoords0.y)*cos(5.5-ex_texcoords0.x); gl_Position = projectioncameramatrix * ex_vertexposition; //normals mat3 nmat = mat3(entitymatrix_); ex_normal = normalize(nmat * vertex_normal); ex_tangent = normalize(nmat * vertex_tangent); ex_binormal = normalize(nmat * vertex_binormal); //texture coordinates ex_texcoords0 = vertex_texcoords0; } Quote Link to comment Share on other sites More sharing options...
Marcousik Posted April 4, 2023 Share Posted April 4, 2023 No it absolutely does not. (but thx for helping) it only works if I add this absurd Wind lines Quote //Wind float time = currenttime/currenttime; if (vertex_position.y > 100.1) { ex_vertexposition.x += 0.25*cos(1.0*ex_vertexposition.y/2 + 1) * sin(1.0*ex_vertexposition.y/4 + 1); //must go //between these other two lines } As I said it is not a big problem, only annoying because not really to understand. Here is a WIP showcase Part 2 for mud shader: 1 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted April 5, 2023 Author Share Posted April 5, 2023 Yeah sorry man I don't know what's going on with that. If it works in game then I guess it's cool. That mud looks good. I wish I could figure out the footprint thing but it's still beyond me at this point. Quote Link to comment Share on other sites More sharing options...
Marcousik Posted April 5, 2023 Share Posted April 5, 2023 One more, thx a lot for the all your work on the shader you made, witout that I wouldn't have got the possibility to continue on this. The key is this shader effect around a specific entity 1 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.