steve3d Posted August 7, 2013 Posted August 7, 2013 I want to write a custom shader for ObjectDynamic, which will need a camera direction. but the shader system has no variable defined as s_camera_dir or s_camera_direction. so how can I get the camera's direction in shader? I'm assuming using column 3 of s_imodelview matrix should be the camera direction. But I'm not sure this is right.
frustum Posted August 7, 2013 Posted August 7, 2013 Unigine render is camera relative. So in terms of shaders camera direction is 0,0,1 or (0,0,-1). s_imodelview matrix is required only if you need to get world-space camera direction.
steve3d Posted August 7, 2013 Author Posted August 7, 2013 Yes, I need the world space camera direction, so column 3 of s_imodelview is the camera direction in world space?
Recommended Posts