Page 1 of 1
Tree/Foliage Vertex Shader (101)
Posted: 04 Mar 2016, 19:00
by Forboding Angel
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)
Posted: 04 Mar 2016, 19:14
by gajop
https://github.com/gajop/Custom-Unit-Shader-Framework
PS: Search forums better please. (third time posting this in less than a week)
Re: Tree/Foliage Vertex Shader (101)
Posted: 04 Mar 2016, 21:19
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)?
Re: Tree/Foliage Vertex Shader (101)
Posted: 04 Mar 2016, 21:29
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
Re: Tree/Foliage Vertex Shader (101)
Posted: 04 Mar 2016, 22:07
by Forboding Angel
Oh super simple! Daddy Liek! :-D
Re: Tree/Foliage Vertex Shader (101)
Posted: 31 Mar 2016, 16:45
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.