hi,
I am trying to create displacement filter.
I create displacment based on procedural map ( sin) but i look bad.
I want to set additional texture for Fragment shader but something is wrong.
Were i put texture to sampler i get black image on fs0 (i want to post process/displace currentFrame of view3d)
my code in FishEyeFilterTask
override protected function getVertexCode():String
{
return "mov op, va0n" +
"mov v0, va1n";
}
override protected function getFragmentCode():String
{
//trying to get view when context.setTextureAt(1, _t); is call = black screen on all samplers
return "tex oc, v0, fs0 <2d,linear,nomip>n";
}
override public function activate( stage3DProxy:Stage3DProxy, camera3D:Camera3D, depthTexture:Texture ):void
{
// TODO: not used
camera3D = camera3D;
depthTexture = depthTexture;
var context:Context3D = stage3DProxy._context3D;
//set on sampler1 but all saplers are black
context.setTextureAt(1, _t);
context.setProgramConstantsFromVector( Context3DProgramType.VERTEX, 0, _data, 3 );
context.setProgramConstantsFromVector( Context3DProgramType.FRAGMENT, 0, _data, 3 );
}
trying to get view when context.setTextureAt(1, _t); (_t is displacment map texture) is called = black screen on all samplers
I only get something when i put displacment map texture on fs0 but this owerrides screen frame.
yes i am changing fragment code to sample 1to see displacment map but it is black (fs0 also)
return “tex oc, v0, fs1 <2d,linear,nomip>n”;