Tree/Foliage Vertex Shader (101)
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Tree/Foliage Vertex Shader (101)
So how does one get hold of such a thing, and how would one incorporate it into his maps?
Re: Tree/Foliage Vertex Shader (101)
https://github.com/gajop/Custom-Unit-Shader-Framework
PS: Search forums better please. (third time posting this in less than a week)
PS: Search forums better please. (third time posting this in less than a week)
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Tree/Foliage Vertex Shader (101)
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)?
Re: Tree/Foliage Vertex Shader (101)
Here's the logic used to detect trees - very simple and based on a def name.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)?
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
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Tree/Foliage Vertex Shader (101)
Oh super simple! Daddy Liek! :-D
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Tree/Foliage Vertex Shader (101)
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.
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.