Page 1 of 1

Amplify2 and user created mappings/caches?

PostPosted: Fri Sep 06, 2013 1:10 pm
by Andy
Yay FIRST!

I wonder if Amplify2 supports user created caches/mappings, means Amplify1 only supports 2 mappings for _MainColor.rgba and _BumpMap.rgba. There is no way to add extra mappings/textures, since the Shared.cginc directly works with the hardcoded names VTSampleBase(), VTSampleNormal() and _VTDiffuseCache/_VTNormalCache.

Since additional mappings would behave the same way, we would like the ability to define extra mappings. Shader support could be added by either using #defines/includes where extra names are mapped/defined or by using some default naming convention like:

VTSampleBase1(), VTSampleBase2(), VTSampleBase3(), VTSampleBase4(): to support a max. of 4 Base mappings.
and
uniform sampler2D _VTDiffuseCache1;
uniform sampler2D _VTDiffuseCache2;
uniform sampler2D _VTDiffuseCache3;
uniform sampler2D _VTDiffuseCache4;

Alternative some preprocessor magic:
#define DefineTextureMapping(idx) \
uniform sampler2D _VTDiffuseCache##idx; \
inline float4 VTSampleBase##idx( VirtualCoord vcoord ) {....}

So basically allow a more dynamic setup, if additional mappings are needed.


bye Andy

Re: Amplify2 and user created mappings/caches?

PostPosted: Sat Sep 07, 2013 5:27 pm
by Diogo Teixeira
Hi Andy!

That is something I've personally been wanting to do for a while now. We definitely need a more flexible channel system. However, it would require refactoring a big portion of our system. If we do go forward with it, might be at a later time.

If we do change this, however, one thing that we'll have to keep is packing our channels in sets of 4. Your idea is still valid in this case, though. We'll certainly take your suggestion into consideration.

Thanks for taking the time to post. Your feedback is very important to us.