當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。