Hacked Terrain and grass shader: post your stats!!

hi, I’ve been working on the terrain shaders for about 2 week and I just wanted to share with u what I achieved. So, basically the shaders need SM3 and I tried to optimize them as I can, then grass is fade out over distance between the camera and the verts, then terrain textures are masked b a far ColorMap, shown if far from the terrain, otherwise u’ll see a detail texture

—> http://dl.dropbox.com/u/91501658/wm/WebPlayer.html

PS : terrain details textures are just made up by four grayscale texture * colorMap(from WM basic[rgb]) then normals are provided to the terrain in order to gain normal mapping and specularity(just let me know if u like this effect or if I should use rgb detail textures)

PS : grass still needs some performance improvement, cause in the vert function it uses complex math calculation on the gpu(based on larsberthan’s advanced terrain shaders)

PS: every value in the shader is fully customizable by the attached terrain script
PS: models were taken from Bootcamp demo and fixed to have a correct lighing

Hope u enjoy

NOTE : the demo is quite heavy and the game’s camera uses HDR, so is recommended to close main apps

if u have any trouble just post here or pm me

why using the word hacking doesn’t make sense ?

Man, i have been waiting for this shader so long, this is amazing now Worldmachine workflow is completly handled on Unity terrain. Terrain looks excellent, even controler feels very good. Please tell that you are going to sell this shader i would really need it.
Just maybe one little input, color darkness between main color map and detail maps is quite huge, is there any way you could somehow blend them little better, maybe even decrease detail maps visibility?

That is fu*king beautiful!

Wow, looks amazing.
I 2nd Janpec, I want it :slight_smile:

unfortunately this does not work on mac: the terrain is just black…

lars

I can second this, I’m getting a black terrain on my MacBook Pro, on a Radeon HD 6750M (which should support this in theory, since it goes up to Shader Model 5).

Intel HD 3000 + Windows 7 64bit here, works fine. 60FPS max, 48FPS Min.

Now, onto critique:
General Critique:

  • The mouse control in this demo is one of the best I have ever used in any Unity game.
  • I love the Shadow :wink: Beautiful cylinder!
  • Only good headbob I have seen in Unity so far.
  • I like how you move slower on inclines. But you should move slower backwards as well.

Shader/Terrain specific critique:

  • TBH, the sun glare bugs me.
  • Also, what is “hacked” about the grass? IMHO, The grass texture fades MUCH too fast. I see the grass texture clearly for like, 2 units in front of me.
  • While the terrain looks nice, it is too bright at a certain location in the game. Much too bright.

Runs at 60 fps, looks great. I just found it funny that the leaves that are constantly flying around are “fall leaves” but the trees in the scene are all evergreens :slight_smile:

Tch tch tch. Not working on Macs, but it does work on Windows? Better re-write your shaders, dude.

EDIT: This is what I’m seeing on my display for those with Macs. Looks simply amazing: may I please, please have this shader? Everything is so amazing looking (except for the grass, but that’s replaceable with a better texture)! Also, use RGB detail textures. It will be much faster and easier to render. Also, please decrease the bloom effect, or give a way to turn it off. It’s way too strong for my eyes.

The old school definition of hacking is to modify something to make it work in a different way than intended. So although the media is quick to say hacking is evil and illegal, that’s generally considered cracking by the “hackers”.

Basically all the shaders I’ve made with Unity have been hacks of unity’s built-in, sixtimesnothing’s or Lars Bertram’s shaders. Before Unity I did write a few shaders, but with such good shaders and the Unity pipeline its just faster to hack something that’s almost right to start with.

PS: It should be noted that the terms hackers and crackers still belongs in an urban dictionary, as different people will tell you different interpretations of the words. I’m quite certain the OP meant this older definition of the word and did not imply illegal actions on his part. :slight_smile:

Oh and speaking of OP: Nice work! Look really good. Though I’m getting some annoying glitches. It does look somewhat like a vsync issue, can you try making a vsync version?

Yah I just get black too. The buildings/trees/props are colored.

Okay, now that is beautiful.

If you can make this work on a Mac, I will never use the default terrain shaders again.

Ay. I gotta get those shaders. Are they a drop-in replacement for Unity’s shaders, or do you have to work around a bit with your materials?

I had something similar happening on my terrain shader, but only on Macs with older Intel chipsets. I wasn’t sure what the problem was, but it appeared to be the chipset believing it could handle more texture units than it actually could(although that is supposition), and using the shader level 3.0 path on Intel GMA level hardware where it should be using the 2.0 path, both of which are probably part of the same problem.

I’m on a newer Intel Mac and the terrain just looks solid black to me? Also what have you done to the mouseLook? It’s awesome! Can you share the mouse looking script?

Even on brand new Macs, the terrain is black. This is because he wrote his shaders in DirectX format and not in a format compatible with both X and OpenGL.

I’d love to use it as well. It’s so smooth.

The mouselook you have is pure awesome. The grass on my machine is, like many other people’s, pure black, which is shame because other posters say it looks good and I’d like to see it. I’m on an intel Mac Pro with an AMD Radeon HD 5870.

I’ve posted a pic up a ways showing what it looks like on my machine. I’ll try and upload more later.

Very nice!
Texturing on the buildings too.