CubeMap samplers in Max 2009

Hey,

I’ve been having some problems using cubemaps within max 2009, for whatever reason it will only load the first face of the image.

I’ve tried using both the default fx file parser and the ‘string ParamID = “0x003”;’
but to no avail.

Has anyone experienced this before, and if so, found a fix?

Thanks,

Tom

Seems to be working fine for me (using ShaderFX anyway).

Here’s part of the header:

/*** Generated through Lumonix shaderFX  by: kees in 3dsmax at: 29/07/2008 11:11:38 AM  ***/ 

// This FX shader was built to support 3ds Max's DXSAS shader compiler. 
string ParamID = "0x003";	// this string tells 3ds Max to use the DXSAS compiler 
 


texture UICubeMap_2401 : environment
<
	string ResourceName = "sky_cube_mipmap.dds";
	string UIName = "Cube Map";
	string ResourceType = "Cube";
>;
 
samplerCUBE UICubeMap_2401Sampler = sampler_state
{
	Texture = <UICubeMap_2401>;
	MinFilter = LINEAR;
	MagFilter = LINEAR;
	MipFilter = LINEAR;
};

The string ParamID = “0x003”; line fixed my shader.
Does anyone care to explain what the DXSAS compiler is?
is there a problem with the Max2009 compiler, or do we need to include this string ParamID in all version of max .FX shaders?

/explode

DXSAS stands for DirectX Standard Annotations and Semantics. It’s referring to all the script extras you include in an FX file beyond your shader code that allow the automatic UI to be generated, different passes to be managed, and data and textures supplied to the hardware. You can read about it here:
http://msdn.microsoft.com/en-us/library/bb173004%28VS.85%29.aspx

There are different versions of the parser supported by Max, partly for backwards compatibility, partly to support both HLSL and CG. Ben summarizes the different versions here:

http://tech-artists.org/forum/showpost.php?p=7498&postcount=6