4 namespace droid.Runtime.Utilities.GameObjects.NeodroidCamera {
8 [RequireComponent(typeof(Camera))]
18 [Header(
"Specific", order = 102)]
20 Camera _camera = null;
22 ComputeBuffer _transformation_compute_buffer;
23 CommandBuffer _transformation_command_buffer;
26 if (this._camera == null) {
27 this._camera = this.GetComponent<Camera>();
30 this.MyRenderTexture =
new RenderTexture(256, 256, 0) {enableRandomWrite =
true};
31 this.MyRenderTexture.Create();
33 if (this._TransformationComputeShader) {
34 var kernel_id = this._TransformationComputeShader.FindKernel(
"CSMain");
36 this._transformation_command_buffer =
new CommandBuffer();
61 this._transformation_command_buffer.SetComputeTextureParam(this._TransformationComputeShader,
64 this.MyRenderTexture);
66 this._transformation_command_buffer.DispatchCompute(this._TransformationComputeShader,
76 if (this._TransformationComputeShader) {
77 this._TransformationComputeShader.SetTexture(0,
"Result", this.MyRenderTexture);
79 this._TransformationComputeShader.Dispatch(0, 256 / 32, 256 / 32, 1);
86 public RenderTexture MyRenderTexture {
get;
set; }
104 if (this._transformation_command_buffer != null) {
105 this._camera.RemoveCommandBuffer(CameraEvent.AfterEverything,
this._transformation_command_buffer);
ComputeShader _TransformationComputeShader