当前位置: 首页>>代码示例>>Java>>正文


Java UniformBinding类代码示例

本文整理汇总了Java中com.jme3.shader.UniformBinding的典型用法代码示例。如果您正苦于以下问题:Java UniformBinding类的具体用法?Java UniformBinding怎么用?Java UniformBinding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UniformBinding类属于com.jme3.shader包,在下文中一共展示了UniformBinding类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addWorldParam

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
/**
 * Adds a new world parameter by the given name.
 * 
 * @param name The world parameter to add.
 * @return True if the world parameter name was found and added
 * to the list of world parameters, false otherwise.
 */
public boolean addWorldParam(String name) {
    if (worldBinds == null){
        worldBinds = new ArrayList<UniformBinding>();
    }
    
    try {
        worldBinds.add( UniformBinding.valueOf(name) );
        return true;
    } catch (IllegalArgumentException ex){
        return false;
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:20,代码来源:TechniqueDef.java

示例2: loadShader

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
private void loadShader(AssetManager manager) {
    // recompute define list
    DefineList allDefines = new DefineList();
    allDefines.addFrom(def.getShaderPresetDefines());
    allDefines.addFrom(defines);

    ShaderKey key = new ShaderKey(def.getVertexShaderName(),
            def.getFragmentShaderName(),
            allDefines,
            def.getShaderLanguage());
    shader = manager.loadShader(key);
    if (shader == null) {
        logger.warning("Failed to reload shader!");
        return;
    }

    // refresh the uniform links
    //owner.updateUniformLinks();

    // register the world bound uniforms
    worldBindUniforms.clear();
    for (UniformBinding binding : def.getWorldBindings()) {
        Uniform uniform = shader.getUniform("g_" + binding.name());
        uniform.setBinding(binding);
        if (uniform != null) {
            worldBindUniforms.add(uniform);

        }
    }

    needReload = false;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:33,代码来源:Technique.java

示例3: AddWorldParameterDialog

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
/**
 * Creates new form AddMaterialParameter
 */
public AddWorldParameterDialog(java.awt.Frame parent, boolean modal, Diagram diagram, Point clickPosition) {
    super(parent, modal);
    initComponents();
    DefaultComboBoxModel model = new DefaultComboBoxModel();

    for (UniformBinding binding : UniformBinding.values()) {
        model.addElement(binding);
    }
    this.diagram = diagram;
    this.clickPosition = clickPosition;
    nameField.setModel(model);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:16,代码来源:AddWorldParameterDialog.java

示例4: addWorldParam

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
public void addWorldParam(UniformBinding binding, Point point) {

        ShaderNodeVariable param = new ShaderNodeVariable(binding.getGlslType(), binding.name());
        NodePanel np = new NodePanel(param, NodePanel.NodeType.WorldParam);
        addNode(np);
        np.setLocation(point.x, point.y);
        np.revalidate();
        repaint();
        getEditorParent().notifyAddWorldParam(binding.name());
    }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:11,代码来源:Diagram.java

示例5: jButton1ActionPerformed

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    diagram.addWorldParam((UniformBinding) nameField.getSelectedItem(), clickPosition);
    setVisible(false);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:5,代码来源:AddWorldParameterDialog.java

示例6: getWorldParamType

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
public static String getWorldParamType(String name) {
    return UniformBinding.valueOf(name).getGlslType();
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:4,代码来源:MaterialUtils.java

示例7: getWorldBindings

import com.jme3.shader.UniformBinding; //导入依赖的package包/类
/**
 * Returns a list of world parameters that are used by this
 * technique definition.
 * 
 * @return The list of world parameters
 */
public List<UniformBinding> getWorldBindings() {
    return worldBinds;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:TechniqueDef.java


注:本文中的com.jme3.shader.UniformBinding类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。