Tree/Foliage Vertex Shader (101)

Tree/Foliage Vertex Shader (101)

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Tree/Foliage Vertex Shader (101)

Post by Forboding Angel »

So how does one get hold of such a thing, and how would one incorporate it into his maps?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Tree/Foliage Vertex Shader (101)

Post by gajop »

https://github.com/gajop/Custom-Unit-Shader-Framework

PS: Search forums better please. (third time posting this in less than a week)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tree/Foliage Vertex Shader (101)

Post by Forboding Angel »

Github won't let me search forked repos and I can't clone it atm. Where are the features that it affects defined? Does it make use of the category tag (vegetation)?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Tree/Foliage Vertex Shader (101)

Post by gajop »

Forboding Angel wrote:Github won't let me search forked repos and I can't clone it atm. Where are the features that it affects defined? Does it make use of the category tag (vegetation)?
Here's the logic used to detect trees - very simple and based on a def name.
Should be easy to change it to parse the category tag or whatever you may want.

Code: Select all

-- All feature defs that contain the string "aleppo" will be affected by it
for id, featureDef in pairs(FeatureDefs) do
  if featureDef.name:find("aleppo") then
    featureMaterials[featureDef.name] = "feature_tree"
  end
end
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Tree/Foliage Vertex Shader (101)

Post by Forboding Angel »

Oh super simple! Daddy Liek! :-D
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Tree/Foliage Vertex Shader (101)

Post by Google_Frog »

This brings up an important issue with shaders. If shaders are in maps then how do we stop them fighting with game shaders? The tree shader is going to be included in games because it would be painful to update all the old maps. But new maps should be able to include feature shaders which are more appropriate than the generic ones included in games.

Games need a way to detect that a map includes shaders. Ideally this would be done in a standard and sane way. Perhaps maps could set feature rules params for the features which should be ignored by gameside shaders? Perhaps a map shader could just set something in GG (or game rules) which tells game shaders to ignore all map features. We also need to avoid name conflicts between map shader gadgets and game shader gadgets.
Post Reply

Return to “Map Creation”