本文整理汇总了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;
}
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}
示例6: getWorldParamType
import com.jme3.shader.UniformBinding; //导入依赖的package包/类
public static String getWorldParamType(String name) {
return UniformBinding.valueOf(name).getGlslType();
}
示例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;
}