SpiderPig Posted May 18, 2017 Share Posted May 18, 2017 I'm looking for someone to write a terrain shader that will texture a terrain model based on height and slope. I want it to use uniforms for the height and slope of each layer so I can change them through code. It will need to use at least four layers - each with diffuse, normal and specular maps. If it can use more layers that would be better. Also I would like the option to use an alpha map to further control where textures are shown. The terrain is a cube, pictured below; Would like it by the end of the month if possible. Will pay for the work too. PM me if interested. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 19, 2017 Share Posted May 19, 2017 Not sure you can allocate 13 channels? (4 diffuse, 4 normal, 4 specular + 1 for alpha), can't test right now. Might work if you pack specular into the alpha channel of the normal texture, then you would need only 9. (4 color, 4 normal with specular as alpha) + one mask alpha. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Josh Posted May 19, 2017 Share Posted May 19, 2017 OpenGL 4.0 supports 16 texture units (minimum). 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...
shadmar Posted May 19, 2017 Share Posted May 19, 2017 this is a 4 texture splat shader no normals form LE3 before terrains: 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
shadmar Posted May 19, 2017 Share Posted May 19, 2017 float slope = 1.0-ex_normal.y; vec4 g1=texture(texture0,ex_texcoords0*42); vec4 g2=texture(texture1,ex_texcoords0*42); vec4 g3=texture(texture2,ex_texcoords0*42); vec4 g4=texture(texture3,ex_texcoords0*42); vec4 g1full=texture(texture0,ex_texcoords0); vec4 g2full=texture(texture1,ex_texcoords0); vec4 g3full=texture(texture2,ex_texcoords0); vec4 g4full=texture(texture3,ex_texcoords0); g1=mix(g1,g1full,0.2); g2=mix(g2,g2full,0.2); g3=mix(g3,g3full,0.2); g4=mix(g4,g4full,0.2); outcolor = g1; outcolor = mix(outcolor,g2,smoothstep(0.0,0.05,slope)); outcolor = mix(outcolor,g3,smoothstep(0.01,0.125,slope)); outcolor = mix(outcolor,g4,smoothstep(0.125,0.26,slope)); Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
SpiderPig Posted May 20, 2017 Author Share Posted May 20, 2017 Thanks Shadmar, the code helps a lot. I'm still looking for someone who can do it for me. I've posted the job on UpWork too. https://www.upwork.com/ab/applicants/866045947490144256/job-details Quote Link to comment Share on other sites More sharing options...
nick.ace Posted May 31, 2017 Share Posted May 31, 2017 I'm not sure if you got anyone to work on this, but I would suggest replacing one of Leadwerks texture unit bindings with your own bindings. This way you can support texture arrays, which allow you to have 256+ textures for a single texture unit. This way, you also get sampling modes and mipmapping to work correctly (which can't get with a texture atlas). 1 Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted May 31, 2017 Author Share Posted May 31, 2017 I have the shader now and am making it work with Leadwerks at the moment. What texture bindings are you referring to? More textures would be good. Quote Link to comment Share on other sites More sharing options...
nick.ace Posted June 1, 2017 Share Posted June 1, 2017 Leadwerks allows up to 16 (1-layer) textures to be bound to a material. You can bind your own OpenGL texture array to one of these units, giving you at least 256 texture (I think that's the minimum in the specification). They all must be the same resolution, have the the same number of mipmap levels, and be the same format though. 1 Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted June 1, 2017 Author Share Posted June 1, 2017 Ahh thanks. I'll check it out. 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.