Class SCNTechnique

    • Constructor Detail

      • SCNTechnique

        protected SCNTechnique​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • techniqueBySequencingTechniques

        public static SCNTechnique techniqueBySequencingTechniques​(NSArray<? extends SCNTechnique> techniques)
        techniqueBySequencingTechniques: 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.
        Parameters:
        techniques - The techniques to sequence.
      • techniqueWithDictionary

        public static SCNTechnique techniqueWithDictionary​(NSDictionary<java.lang.String,​?> dictionary)
        techniqueWithDictionary: 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: inputs: draw: program: metalVertexShader: metalFragmentShader: colorStates: //optional depthStates: //optional stencilStates: //optional cullMode: //optional blendStates: //optional viewport: //optional pointOfView: //optional samples: //optional excludeCategoryMask: //optional includeCategoryMask: //optional }, "Pass2" : { [...] } } symbols: { "symbol A": { } [...] } targets: { "target A": { } [...] }, //optional bundle: , metalLibraryName: , } : The possible (and optional) keys with their possible associated values are: color: a string referencing a color render target. See . depth: a string referencing a depth render target. See . stencil: a string referencing a stencil render target. See . : The inputs are listed in a dictionary. The keys are the uniform name as specified in the program of this pass. The values can be a single string referencing a symbol or a semantic or a target OR a dictionary with the following structure: { 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.) A string referencing a target (i.e an entry in the top level "targets" dictionary) or one of the special strings below: COLOR The render target that represents that main color fragments that will be displayed on the screen ultimately. DEPTH The render target that represents that main depth fragments. can be one of the following strings: DRAW_SCENE: render the entire scene DRAW_QUAD: render a fullscreen quad DRAW_NODE: render a node and its sub-tree. The node is specified by setting its name as the value for the key "node". Name of a program (a vertex shader + a fragment shader) located in the application bundle. The vertex shader must have the extension "vsh" and the fragment shader "fsh". Name of a METAL function to use as the vertex shader. Name of a METAL function to use as the fragment shader. A dictionary with the following optional keys: "clear" a boolean specifying whether the color target should be cleared or not "clearColor" a string specifying the clear color as 4 float ("red green blue alpha"), or the string "sceneBackground" to clear with the scene background color. A dictionary with the following optional keys: "clear" a boolean specifying whether the depth target should be cleared or not "enableWrite" a boolean specifying whether writing to depth should be enabled or not. "enableRead" a boolean specifying whether reading from depth should be enabled or not. "func" a string specifying depth function to use. See for the possible values. A dictionary with the following optional keys: "clear" a boolean specifying whether the stencil target should be cleared or not "enable" a boolean specifying whether writing to stencil should be enabled or not. "behavior" a dictionary describing the stencil behavior of the front face, or of both faces if no backFaceBehavior is specified. See for the format of this dictionary. "backFaceBehavior" a dictionary describing the behavior of the back face. See for the format of this dictionary. A dictionary with the following optional keys: "depthFail" a string specifying the operation to do if the depth test fails. See for the possible values. "fail" a string specifying the operation to do if the stencil test fails. See for the possible values. "pass" a string specifying the operation to do if the stencil test passes. See for the possible values. "function" a string specifying the stencil test. See for the possible values. "readMask" a uint8_t number specifying a mask that is ANDed with both the reference value and the stored stencil value when the test is done "writeMask" a uint8_t number specifies a bit mask to enable and disable writing of individual bits in the stencil planes "referenceValue" a uint8_t number specifies the reference value for the stencil test. The initial value is 0. A string specifying a stencil operation. It can be one of the following: keep, zero, replace, increment, decrement, invert, incrementWrap, decrementWrap A string specifying a comparison function. It can be one of the following: never, always, equal, notEqual, less, lessEqual, greater, greaterEqual A dictionary with the following optional keys: "enable" a boolean number specifying if the blending should be enabled or not. defaults to true. "colorSrc" a string specifying a blend mode. See "colorDst" a string specifying a blend mode. See "alphaSrc" a string specifying a blend mode. See "alphaDst" a string specifying a blend mode. See "colorOp" a string specifying a blend operation. See "alphaOp" a string specifying a blend operation. See In no Blend states are specified, then the blending is turned off. A string specifying a blend mode. It can be one of the following: zero, one, srcColor, oneMinusSrcColor, srcAlpha, oneMinusSrcAlpha, dstColor, oneMinusDstColor, dstAlpha, oneMinusDstAlpha, constantColor, oneMinusConstantColor, constantAlpha, oneMinusConstantAlpha, alphaSaturate. A string specifying a blend operation. It can be one of the following: add, substract, reverseSubstract, min, max. A string specifying a cull mode. It can be one of the following: front, none, back. A string specifying the viewport as 4 float. A integer value representing a node category mask (see SCNNode's categoryBitMask). if the key "excludeCategoryMask" is not specified then it defaults to 0. if the key "includeCategoryMask" is not specified then it defaults to all bits set. The DRAW_SCENE command will then render nodes that validate the following test (node.categoryBitMask & includeCategoryMask) && !(excludeCategoryMask & node.categoryBitMask). The name of a node, or "self" to reference the owner of the technique if any. The number of samples (multisampling) used to render the pass. A dictionary with the following optional keys and their possible associated values: 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). A dictionary with the following optional keys and their possible associated values: 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. An optional bundle identifier to load metal programs from An optional metal library name to load metal programs from. The metallib file is located from the default or specified bundle using NSBundle pathForResource:ofType:.
        Parameters:
        dictionary - The dictionary representation of the technique.
      • version_static

        public static long version_static()
      • addAnimationForKey

        public void addAnimationForKey​(SCNAnimation animation,
                                       java.lang.String key)
        Description copied from interface: SCNAnimatable
        addAnimation:forKey: Adds 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.
        Specified by:
        addAnimationForKey in interface SCNAnimatable
        Parameters:
        animation - Added animation.
        key - May be any string such that only one animation per unique key is added per animatable object.
      • animationForKey

        public CAAnimation animationForKey​(java.lang.String key)
        Description copied from interface: SCNAnimatable
        animationForKey: Returns 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.
        Specified by:
        animationForKey in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to retrieve.
      • animationKeys

        public NSArray<java.lang.String> animationKeys()
        Description copied from interface: SCNAnimatable
        [@property] animationKeys Returns an array containing the keys of all animations currently attached to the receiver.
        Specified by:
        animationKeys in interface SCNAnimatable
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • dictionaryRepresentation

        public NSDictionary<java.lang.String,​?> dictionaryRepresentation()
        [@property] dictionaryRepresentation Returns the dictionary representation of the technique.
      • handleBindingOfSymbolUsingBlock

        public void handleBindingOfSymbolUsingBlock​(java.lang.String symbol,
                                                    SCNTechnique.Block_handleBindingOfSymbolUsingBlock block)
        handleBindingOfSymbol:usingBlock: 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.
        Parameters:
        symbol - The name of the symbol to bind a value for.
        block - The block to call to bind the specified symbol.
      • isAnimationForKeyPaused

        public boolean isAnimationForKeyPaused​(java.lang.String key)
        Description copied from interface: SCNAnimatable
        isAnimationForKeyPaused: Returns whether the animation for the specified identifier is paused.
        Specified by:
        isAnimationForKeyPaused in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to query.
      • objectForKeyedSubscript

        public 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. Even if the key `myAmplitude` is not a declared property of the class, you can still set a value for it. If the Property List file declares the `myAmplitude` symbol, any change to the `myAmplitude` property of the receiver will make SceneKit bind the associated uniform with the new value. 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;
      • pauseAnimationForKey

        public void pauseAnimationForKey​(java.lang.String key)
        Description copied from interface: SCNAnimatable
        pauseAnimationForKey: Pause the animation with the given identifier.
        Specified by:
        pauseAnimationForKey in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to pause.
      • removeAnimationForKey

        public void removeAnimationForKey​(java.lang.String key)
        Description copied from interface: SCNAnimatable
        removeAnimationForKey Remove the animation with the given identifier.
        Specified by:
        removeAnimationForKey in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to remove.
      • removeAnimationForKeyFadeOutDuration

        public void removeAnimationForKeyFadeOutDuration​(java.lang.String key,
                                                         double duration)
        Description copied from interface: SCNAnimatable
        removeAnimationForKey:fadeOutDuration: Smoothly remove the animation with the given identifier.
        Specified by:
        removeAnimationForKeyFadeOutDuration in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to remove.
        duration - The fade out duration used to remove the animation.
      • resumeAnimationForKey

        public void resumeAnimationForKey​(java.lang.String key)
        Description copied from interface: SCNAnimatable
        resumeAnimationForKey: Resume the animation with the given identifier.
        Specified by:
        resumeAnimationForKey in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to resume.
      • setObjectForKeyedSubscript

        public void setObjectForKeyedSubscript​(java.lang.Object obj,
                                               java.lang.Object key)
      • setSpeedForAnimationKey

        public void setSpeedForAnimationKey​(double speed,
                                            java.lang.String key)
        Description copied from interface: SCNAnimatable
        setSpeed:forAnimationKey: Update the animation speed of the animation with the given identifier.
        Specified by:
        setSpeedForAnimationKey in interface SCNAnimatable
        Parameters:
        speed - The new speed of the animation.
        key - The identifier for the animation to update.
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • addAnimationPlayerForKey

        public void addAnimationPlayerForKey​(SCNAnimationPlayer player,
                                             java.lang.String key)
        Description copied from interface: SCNAnimatable
        addAnimationPlayer:forKey: Add 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.
        Specified by:
        addAnimationPlayerForKey in interface SCNAnimatable
        Parameters:
        player - Added animation player.
        key - May be any string such that only one animation per unique key is added per animatable object.
      • animationPlayerForKey

        public SCNAnimationPlayer animationPlayerForKey​(java.lang.String key)
        Description copied from interface: SCNAnimatable
        animationPlayerForKey: Returns the animation player with the given identifier This will return nil if no such animation player exists.
        Specified by:
        animationPlayerForKey in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation player to retrieve.
      • removeAnimationForKeyBlendOutDuration

        public void removeAnimationForKeyBlendOutDuration​(java.lang.String key,
                                                          double duration)
        Description copied from interface: SCNAnimatable
        Smoothly remove the animation with the given identifier.
        Specified by:
        removeAnimationForKeyBlendOutDuration in interface SCNAnimatable
        Parameters:
        key - The identifier for the animation to remove.
        duration - The blend out duration used to remove the animation.
      • library

        public MTLLibrary library()
        [@property] 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.
      • setLibrary

        public void setLibrary​(MTLLibrary value)
        [@property] 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.