public class SCNTechnique extends NSObject implements SCNAnimatable, NSCopying, NSSecureCoding
SCNTechnique represents a rendering process that may require multiple passes.
A technique is generally initialized from a Property List file. It can be set to any object that conforms to the SCNTechniqueSupport protocol.
| Modifier and Type | Class and Description |
|---|---|
static interface |
SCNTechnique.Block_handleBindingOfSymbolUsingBlock |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
SCNTechnique(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
void |
addAnimationForKey(SCNAnimation animation,
java.lang.String key)
addAnimation:forKey:
|
void |
addAnimationPlayerForKey(SCNAnimationPlayer player,
java.lang.String key)
addAnimationPlayer:forKey:
|
static SCNTechnique |
alloc() |
static SCNTechnique |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
CAAnimation |
animationForKey(java.lang.String key)
animationForKey:
|
NSArray<java.lang.String> |
animationKeys()
[@property] animationKeys
|
SCNAnimationPlayer |
animationPlayerForKey(java.lang.String key)
animationPlayerForKey:
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
java.lang.Object |
copyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
NSDictionary<java.lang.String,?> |
dictionaryRepresentation()
[@property] dictionaryRepresentation
|
void |
encodeWithCoder(NSCoder coder) |
void |
handleBindingOfSymbolUsingBlock(java.lang.String symbol,
SCNTechnique.Block_handleBindingOfSymbolUsingBlock block)
handleBindingOfSymbol:usingBlock:
|
static long |
hash_static() |
SCNTechnique |
init() |
SCNTechnique |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isAnimationForKeyPaused(java.lang.String key)
isAnimationForKeyPaused:
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
MTLLibrary |
library()
[@property] library
|
static SCNTechnique |
new_objc() |
java.lang.Object |
objectForKeyedSubscript(java.lang.Object key)
SCNTechnique is a key-value coding compliant class, which means that you can set values for arbitrary keys.
|
void |
pauseAnimationForKey(java.lang.String key)
pauseAnimationForKey:
|
void |
removeAllAnimations()
removeAllAnimations
|
void |
removeAllAnimationsWithBlendOutDuration(double duration)
removeAllAnimationsWithBlendOutDuration
|
void |
removeAnimationForKey(java.lang.String key)
removeAnimationForKey
|
void |
removeAnimationForKeyBlendOutDuration(java.lang.String key,
double duration)
removeAnimationForKey:blendOutDuration:
|
void |
removeAnimationForKeyFadeOutDuration(java.lang.String key,
double duration)
removeAnimationForKey:fadeOutDuration:
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
resumeAnimationForKey(java.lang.String key)
resumeAnimationForKey:
|
void |
setLibrary(MTLLibrary value)
[@property] library
|
void |
setObjectForKeyedSubscript(java.lang.Object obj,
java.lang.Object key) |
void |
setSpeedForAnimationKey(double speed,
java.lang.String key)
setSpeed:forAnimationKey:
|
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
static SCNTechnique |
techniqueBySequencingTechniques(NSArray<? extends SCNTechnique> techniques)
techniqueBySequencingTechniques:
|
static SCNTechnique |
techniqueWithDictionary(NSDictionary<java.lang.String,?> dictionary)
techniqueWithDictionary:
|
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static SCNTechnique alloc()
public static SCNTechnique allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static SCNTechnique new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public static SCNTechnique techniqueBySequencingTechniques(NSArray<? extends SCNTechnique> techniques)
Creates and returns a technique by sequencing the passes from the specified techniques.
The passes from "techniques" are executed sequentially. The symbols and targets are merged. This allows to use the same uniform ad targets across multiple techniques.
techniques - The techniques to sequence.public static SCNTechnique techniqueWithDictionary(NSDictionary<java.lang.String,?> dictionary)
Creates and returns a technique instance initialized with the specified dictionary.
The format of the dictionary is described below. Quoted strings can be any name of your choice. Tags are defined below. The passes are executed sequentially as specified in the "sequence" section. The definition of each pass is within the "passes" section. A pass may have inputs/outputs that reference targets or symbols defined in the "targets" and "symbols" section. The entries of the "symbols" section can be set/get and animated with SCNTechnique's APIs below.
{
sequence: ["Pass1", "Pass2", ...],
passes: {
"Pass1": {
outputs:
//optional
bundle:
{
target:
//optional:
minificationFilter: linear, nearest
magnificationFilter: linear, nearest
mipFilter: linear, nearest, none
wrapS: clamp, repeat, clampToBorder, mirror
wrapT: clamp, repeat, clampToBorder, mirror
wrapP: clamp, repeat, clampToBorder, mirror
maxAnisotropy: a number
}
(See SCNMaterialProperty for more documentation and default values of these optional parameters.)
semantic: vertex, normal, color, texcoord, tangent, time, modelViewProjectionTransform, modelViewTransform, modelTransform, viewTransform, projectionTransform, normalTransform, modelViewProjectionInverseTransform, modelViewInverseTransform, modelInverseTransform, viewInverseTransform, projectionInverseTransform, normalInverseTransform
type: float, vec2, vec3, vec4, mat4, int, ivec2, ivec3, ivec4, mat3, sampler2D, none. Every types can also be an array of the given type by adding [N] where N is the number of elements in the array.
image: name of an image located in the application bundle. (only valid when type is sampler2D)
if a semantic is set, no type is required.
Note that with Metal shaders you should not provide any semantic. Instead simply declare a struct in you shader and add the members you need named as specified in SceneKit/scn_metal.
For example for a per-node semantic:
struct MyStruct
{
float4x4 modelTransform;
float4x4 modelViewProjectionTransform;
};
then in your function add an argument that must be named “scn_node” to get the members automatically filed with node semantics (see the documentation in scn_metal).
type: a string specifying the type of the render target. It can be one of the following: color, depth, stencil
format: a string specifying the format of the render target. It can be:
- for color targets: rgba32f, r8, r16f, rg16 or rgba. If not specified defaults to the framebuffer's pixel format.
- for depth targets: depth24, depth24stencil8
- for stencil targets: depth24stencil8
scaleFactor: a float value (encapsulated in a NSNumber) that controls the size of the render target. Defaults to 1, which means 1x the size of the main viewport.
size: a string with the format %dx%d that controls the size of the render target.
persistent: a boolean that tells if this target should persist from one frame to the next. It permits to create temporal effects suchs as motion blur. Defaults to NO.
dictionary - The dictionary representation of the technique.public static long version_static()
public void addAnimationForKey(SCNAnimation animation, java.lang.String key)
SCNAnimatableAdds and runs an animation
Only SCNAnimation (preferred), CABasicAnimation, CAKeyframeAnimation and CAAnimationGroup are supported. The animation starts playing right away. The animation is automatically removed on completion unless if removedOnCompletion is explicitly set to NO.
addAnimationForKey in interface SCNAnimatableanimation - Added animation.key - May be any string such that only one animation per unique key is added per animatable object. removedOnCompletion] public CAAnimation animationForKey(java.lang.String key)
SCNAnimatableReturns the animation with the given identifier
This will return nil if no such animation exists. Attempting to modify any properties of the returned object will result in undefined behavior.
animationForKey in interface SCNAnimatablekey - The identifier for the animation to retrieve.public NSArray<java.lang.String> animationKeys()
SCNAnimatableReturns an array containing the keys of all animations currently attached to the receiver.
animationKeys in interface SCNAnimatablepublic java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
copyWithZone in interface NSCopyingpublic NSDictionary<java.lang.String,?> dictionaryRepresentation()
Returns the dictionary representation of the technique.
public void encodeWithCoder(NSCoder coder)
encodeWithCoder in interface NSCodingpublic void handleBindingOfSymbolUsingBlock(java.lang.String symbol,
SCNTechnique.Block_handleBindingOfSymbolUsingBlock block)
Sets the block to call at render time to bind the value for the specified symbol of the receiver.
The block will be called at every frame for every pass referencing the specified symbol.
symbol - The name of the symbol to bind a value for.block - The block to call to bind the specified symbol.public SCNTechnique init()
public SCNTechnique initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodingpublic boolean isAnimationForKeyPaused(java.lang.String key)
SCNAnimatableReturns whether the animation for the specified identifier is paused.
isAnimationForKeyPaused in interface SCNAnimatablekey - The identifier for the animation to query.public java.lang.Object objectForKeyedSubscript(java.lang.Object key)
Symbols can be animated using explicit animations.
The following GLSL types (and Objective-C counterparts) can be used to bind symbols:
GLSL types | Objective-C types -------------------------------------- int | NSNumber, NSInteger, int float | NSNumber, CGFloat, float, double vec2 | CGPoint vec3 | SCNVector3 vec4 | SCNVector4 mat4, mat44 | SCNMatrix4
On macOS 10.11 or later and iOS 9 or later you can also use the object subscripting syntax to set values to uniforms. For example: myTechnique[@"myAmplitude"] = aValue;
public void pauseAnimationForKey(java.lang.String key)
SCNAnimatablePause the animation with the given identifier.
pauseAnimationForKey in interface SCNAnimatablekey - The identifier for the animation to pause.public void removeAllAnimations()
SCNAnimatableRemove all animations.
removeAllAnimations in interface SCNAnimatablepublic void removeAnimationForKey(java.lang.String key)
SCNAnimatableRemove the animation with the given identifier.
removeAnimationForKey in interface SCNAnimatablekey - The identifier for the animation to remove.public void removeAnimationForKeyFadeOutDuration(java.lang.String key,
double duration)
SCNAnimatableSmoothly remove the animation with the given identifier.
removeAnimationForKeyFadeOutDuration in interface SCNAnimatablekey - The identifier for the animation to remove.duration - The fade out duration used to remove the animation.public void resumeAnimationForKey(java.lang.String key)
SCNAnimatableResume the animation with the given identifier.
resumeAnimationForKey in interface SCNAnimatablekey - The identifier for the animation to resume.public void setObjectForKeyedSubscript(java.lang.Object obj,
java.lang.Object key)
public void setSpeedForAnimationKey(double speed,
java.lang.String key)
SCNAnimatableUpdate the animation speed of the animation with the given identifier.
setSpeedForAnimationKey in interface SCNAnimatablespeed - The new speed of the animation.key - The identifier for the animation to update.public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCodingpublic void addAnimationPlayerForKey(SCNAnimationPlayer player, java.lang.String key)
SCNAnimatableAdd an animation player.
The animation player is not removed automatically on completion. The animation doesn't start playing immediatelly. Call "play" on the player to start playing it.
addAnimationPlayerForKey in interface SCNAnimatableplayer - Added animation player.key - May be any string such that only one animation per unique key is added per animatable object.play]public SCNAnimationPlayer animationPlayerForKey(java.lang.String key)
SCNAnimatableReturns the animation player with the given identifier
This will return nil if no such animation player exists.
animationPlayerForKey in interface SCNAnimatablekey - The identifier for the animation player to retrieve.public void removeAnimationForKeyBlendOutDuration(java.lang.String key,
double duration)
SCNAnimatableSmoothly remove the animation with the given identifier.
removeAnimationForKeyBlendOutDuration in interface SCNAnimatablekey - The identifier for the animation to remove.duration - The blend out duration used to remove the animation.public MTLLibrary library()
The Metal library to use to load the Metal programs specified in the technique description. Defaults to nil which corresponds to the default Metal library.
public void setLibrary(MTLLibrary value)
The Metal library to use to load the Metal programs specified in the technique description. Defaults to nil which corresponds to the default Metal library.
public void removeAllAnimationsWithBlendOutDuration(double duration)
SCNAnimatableSmoothly remove all animations.
removeAllAnimationsWithBlendOutDuration in interface SCNAnimatableduration - The blend out duration used to remove the animation.