Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Categories
- All Discussions1,524
- General534
- Graphics109
- GPU Computing419
- Mobile141
- Pro Graphics163
- Tools158
Tags in this Discussion
- fx-composer 14
How to bind camera position in FX Composer?
-
FX Composer is really a great tool to create shaders.
But I do not find a way to bind the camera position to the shader register. I have checked SAS and other documentations and check the internet and did not find a way to make it work.
I have tried (PerspectiveCamera1 is the name of the Perspective camera that I have added):
float3 Camera1 : POSITION <
string Object = "Camera";
>;
float3 Camera2 : POSITION <
string Object = "PerspectiveCamera1";
>;
float3 Camera3 : CAMERAPOSITION;
float3 Camera4 : CAMERAPOSITION <
string Object = "Camera";
>;
float3 Camera5 : CAMERAPOSITION <
string Object = "PerspectiveCamera1";
>;
float3 Camera6 : CAMERAPOSITION <
string Object = "PerspectiveCamera1";
>;
float3 Camera7 : POSITION <
string Object = "Node7";
>;
I also tried to use VIEWINVERSE but could not get just its transform part into float3.
So many shaders are using CameraPosition or EyePosition so there should be a way to do the binding. Could you please tell me how to do this. (By the way binding light position works great).