i feel that no one is using shader since it is very hard to implement them
even worse great shders like normal and parralx mapping cant be used on level maps since they need to be generated for every texture being loaded
a better shader system would be one like in commercial games
eg; .tik files in MOHAA
where each texture beingloaded has a shader file withe the same name also being loaded automatically
this will make it easy for shader implementation on any mesh including bsps and levels etc...
i know variables used by the shader have to be declared in the c++ code
but if we do it this way ther will be a standard shader format that willbe used for irrlicht
so we will still use hlsl and cg etc.. but they will be written in a way that the automatic loader would apply them to the texture of the same name as the shader
we dont want to wate this really good feature
what do u think niko
thanx for the incredible engine
better shader system
Couldn't you save the regular texture's location in a string and then have a simple naming convention like say "_h" on the end for height maps, use the string to load the texture, and then add the "_h" to the string to assign the heightmap texture all in one quick function and through this avoid bugging Niko so he can do more important things?
-
- Posts: 12
- Joined: Mon Jul 04, 2005 3:04 am
- Location: Amerika
- Contact:
Actually, I think it should probably be roughly the other way around.
What you mention sounds like there might be a separate shader per texture.
Shader switches are supposedly expensive, so making one shader per texture would result in a lot of overhead.
Instead, it might be better if Irrlicht could create material types from files, would assign a simple default material type to textures from BSPs/meshes, and allow setting the material type for an existing material.
E.g.:
1. You load the map into Irr. Irr creates materials named the same way as the textures used. The materials themselves are of a simple materialtype.
2. You load one or more files to create your own material types. (shaders/texture combiner settings would come from those files)
It's probably best to use a config file which lists which material type files to load. That allows you to edit each material type in its own file.
3. You assign new material types to those materials created in step 1, by means of the material name. It's probably best to store this assignment information in one file per map.
The advantage of this is that you keep the material types (and that means shader objects) to a minimum. So when rendering, it would be possible to sort by material type, then by material (texture switches may also be expensive), and then render.
At the very least, it allows you to keep your own shader maintenance down.
What you mention sounds like there might be a separate shader per texture.
Shader switches are supposedly expensive, so making one shader per texture would result in a lot of overhead.
Instead, it might be better if Irrlicht could create material types from files, would assign a simple default material type to textures from BSPs/meshes, and allow setting the material type for an existing material.
E.g.:
1. You load the map into Irr. Irr creates materials named the same way as the textures used. The materials themselves are of a simple materialtype.
2. You load one or more files to create your own material types. (shaders/texture combiner settings would come from those files)
It's probably best to use a config file which lists which material type files to load. That allows you to edit each material type in its own file.
3. You assign new material types to those materials created in step 1, by means of the material name. It's probably best to store this assignment information in one file per map.
The advantage of this is that you keep the material types (and that means shader objects) to a minimum. So when rendering, it would be possible to sort by material type, then by material (texture switches may also be expensive), and then render.
At the very least, it allows you to keep your own shader maintenance down.