Jump to content

2.2: Different textures per shader stage


photo

Recommended Posts

In 2.1, it used to be possible to bind different textures to different shader stages but the same texture unit. For example:

 

<?xml version="1.0" encoding="utf-8"?>

<materials version="2.1">     

<material name="test_mat">

<texture unit="0" name="tex0" shader="vertex" pass="ambient"/>
<texture unit="0" name="tex1" shader="fragment" pass="ambient"/>
</material>
</materials>
 
tex0 and tex1 could be different textures in the vertex and fragment stages.
In 2.2, the same material would look like this:
 

<?xml version="1.0" encoding="utf-8"?> 

<materials version="2.2">     

<material name="test_mat">

<texture unit="0" name="tex0" shader="all" pass="ambient"/>
<texture unit="0" name="tex1" shader="fragment" pass="ambient"/>
</material>
</materials>
 
However, this no longer works, because since the texture "tex0" that should be bound to the "all" vertex stage is overriden by the bind of "tex1" to the fragment stage.
 
I have a material that has 19 textures. The texture array functionality in 2.2 is not exposed, so I consider this regression a bug, since it is no longer possible for the material to work without major refactoring.

 

Link to comment

Hi Michel,

 

This is not a regression, we've slightly changed how engine handles textures internally. Right now it is not possible to have more than 16 textures per program (vertex / fragment / eval in DX11). If you can provide us a test scene that illustrates issue - we will try to find optimal solution to restore that kind of functionality.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...