Ticket #1493 (closed enhancement: fixed)
[PATCH] Data-driven texture loading
|Reported by:||myconid||Owned by:||myconid|
|Priority:||Nice to Have||Milestone:||Alpha 11|
|Component:||Core engine||Keywords:||patch texturing|
At the moment, actor files only permit a <texture> tag, which allows the loading of a single diffuse texture per actor.
I propose a new system that allows multiple texture <samplers> to be loaded dynamically from the Actor files, thus deprecating the existing <texture> tag.
Under this system, the fixed renderpath looks for a hardcoded sampler named "baseTex", which represents the diffuse texture that <texture> used to provide. There are no other changes to the way the fixed renderpath works.
The real usefulness of this addition, however, becomes apparent in shader mode. An arbitrary number of samplers can be loaded and bound to identifier names, which are automatically exposed in the shader program associated with the Actor's material. This sets up a framework that is better suited for visual effects that require data from samplers, such as normal and specular mapping.
This proposal allows samplers to be loaded in the Actor xml files as follows:
<samplers> <sampler name="baseTex" path="base.png"/> <sampler name="normTex" path="norm.png"/> </samplers>
The "baseTex" is seen by the fixed renderer as if it is a <texture> tag. In the shaders, these will be bound to:
uniform sampler2D baseTex; uniform sampler2D normTex;
Note that <texture> is deprecated but not removed. Under the hood, it redirects to the generalised <sampler> code.
- Keywords patch review added
- Summary changed from Data-driven texture loading to [PATCH] Data-driven texture loading
- Milestone changed from Backlog to Alpha 11
comment:10 Changed 10 months ago by quantumstate
- Status changed from new to closed
- Resolution set to fixed