-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a12 added SyphonClientTextureProjector script, and made it so that Sy…
…phonClientTexture adds the mainTexture on all materials on a gameObject, not just the first
- Loading branch information
1 parent
33842fa
commit 3377442
Showing
22 changed files
with
280 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+709 Bytes
(100%)
Syphon Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assembly-CSharp-Editor.pidb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.51 KB
(110%)
Syphon Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assembly-CSharp-firstpass.pidb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+139 Bytes
(100%)
...mplementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assembly-UnityScript-firstpass.pidb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...onUnityExample/Assets/Plugins/SyphonTexture-AdvancedUsers/SyphonClientTextureProjector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (c) 2010-2012 Brian Chasalow, bangnoise (Tom Butterworth) & vade (Anton Marini). | ||
/* | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
|
||
//This script should be applied to any object in the scene, and lets you attach a syphon client texture to any Unity object. | ||
//You may modify the ApplyTexture() method as necessary, to handle projectors, bump maps, etc. | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class SyphonClientTextureProjector : SyphonClientTexture { | ||
// Use this for initialization | ||
[SerializeField] | ||
private Material projectorMaterial; | ||
|
||
public override void ApplyTexture(){ | ||
if(clientObject != null && clientObject.Initialized){ | ||
Projector proj = GetComponent<Projector>(); | ||
if(proj != null && projectorMaterial != null){ | ||
proj.material = projectorMaterial; | ||
proj.material.SetTexture ("_ShadowTex", clientObject.AttachedTexture); | ||
clientObject.AttachedTexture.wrapMode = TextureWrapMode.Clamp; | ||
} | ||
|
||
} | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...tyExample/Assets/Plugins/SyphonTexture-AdvancedUsers/SyphonClientTextureProjector.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.81 KB
...tions/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/SyphonProjectorMaterial.mat
Binary file not shown.
4 changes: 4 additions & 0 deletions
4
.../Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/SyphonProjectorMaterial.mat.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.