newbie questions about TextureEncoding

Hi all,

I’m currently working on translating some shaders into shaderlab.I’ve been pretty successful so far but when I wanted to implement my TextureEncoding I ran into a problem.

here is it:

#define VOLUME_SIZE 32
float4 noise_3d(float3 Pos : POSITION) : COLOR
{
	float4 myNoise = float4(noise((Pos+1)*500),noise((Pos+2)*500),noise((Pos+3)*500),1);
	return normalize(myNoise)*0.009;
}
texture NoiseMap <

    string ResourceType = "VOLUME";
    string function = "noise_3d";
	float3 Dimensions = {VOLUME_SIZE,VOLUME_SIZE,VOLUME_SIZE};
//	int	   miplevels = 1;
	string format = "A8R8G8B8";
>;
sampler3D noisemap = sampler_state
{
    Texture = <NoiseMap>; 
    MipFilter = LINEAR; 
    MinFilter = LINEAR; 
    MagFilter = LINEAR; 
};

Can anybody help me how to translate these snippets into shaderlab?

I’m assuming your problem is the 3d texture. I’ve been wondering that myself :slight_smile: - any planned support for volumetric textures?

For the problem at hand, seeing as you’re only currently using it for a noise-function, you should be able to layout the 3d-slices on a 2d map. But then of course you have the problems from that, like having to do manual filtering and the like.

I will be excitedly awaiting an answer with you… :slight_smile: