Merge branch 'master' into PBRisComing

Conflicts:
	jme3-core/src/main/java/com/jme3/material/Material.java
	jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
define_list_fix
Nehon 10 years ago
commit 327e0125d9
  1. 7
      CONTRIBUTING.md
  2. 6
      jme3-core/src/main/java/com/jme3/input/DefaultJoystickAxis.java
  3. 6
      jme3-core/src/main/java/com/jme3/material/Material.java
  4. 25
      jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
  5. 18
      jme3-core/src/main/java/com/jme3/scene/BatchNode.java
  6. 2
      jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java
  7. 2
      jme3-core/src/main/java/com/jme3/shadow/DirectionalLightShadowRenderer.java
  8. 2
      jme3-core/src/main/java/com/jme3/shadow/PointLightShadowRenderer.java
  9. 2
      jme3-core/src/main/java/com/jme3/shadow/SpotLightShadowRenderer.java
  10. 6
      jme3-core/src/main/java/com/jme3/util/TangentBinormalGenerator.java
  11. 2
      jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java

@ -16,13 +16,6 @@ When you're ready to submit your code, just make a [pull request](https://help.g
- When committing, always be sure to run an update before you commit. If there is a conflict between the latest revision and your patch after the update, then it is your responsibility to track down the update that caused the conflict and determine the issue (and fix it). In the case where the breaking commit has no thread linked (and one cannot be found in the forum), then the contributor should contact an administrator and wait for feedback before committing.
- If your code is committed and it introduces new functionality, please edit the wiki accordingly. We can easily roll back to previous revisions, so just do your best; point us to it and we’ll see if it sticks!
**Note to Eclipse users:** The Eclipse [git client does not support https](http://hub.jmonkeyengine.org/forum/topic/problem-cloning-the-new-git-repository/#post-265594). The current workaround is to use the command line to clone the repository.
To import the local repository as a project follow these steps:
1. Add a line 'apply plugin: eclipse' to your common.gradle file in the main project directory.
2. Navigate to the project directory in command line and execute command 'gradle eclipse'. This will load all the dependancies for eclipse.
3. In Eclipse, add the repository as an existing Java Project.
p.s. We will try hold ourselves to a [certain standard](http://www.defmacro.org/2013/04/03/issue-etiquette.html) when it comes to GitHub etiquette. If at any point we fail to uphold this standard, let us know.
#### Core Contributors

@ -72,8 +72,10 @@ public class DefaultJoystickAxis implements JoystickAxis {
* @param negativeMapping The mapping to receive events when the axis is positive
*/
public void assignAxis(String positiveMapping, String negativeMapping){
inputManager.addMapping(positiveMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, false));
inputManager.addMapping(negativeMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, true));
if (axisIndex != -1) {
inputManager.addMapping(positiveMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, false));
inputManager.addMapping(negativeMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, true));
}
}
/**

@ -789,7 +789,6 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
//Data directly sent in view space to avoid a matrix mult for each pixel
tmpVec.set(dir.getX(), dir.getY(), dir.getZ(), 0.0f);
transposeLightDataToSpace(technique.getDef().getLightSpace(), rm, tmpVec);
lightData.setVector4InArray(tmpVec.getX(), tmpVec.getY(), tmpVec.getZ(), -1, lightDataIndex);
lightDataIndex++;
//PADDING
@ -1156,10 +1155,11 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
*/
public void render(Geometry geom, LightList lights, RenderManager rm) {
autoSelectTechnique(rm);
TechniqueDef techDef = technique.getDef();
Renderer r = rm.getRenderer();
if (techDef.isNoRender()) return;
TechniqueDef techDef = technique.getDef();
Renderer r = rm.getRenderer();
if (rm.getForcedRenderState() != null) {
r.applyRenderState(rm.getForcedRenderState());

@ -111,6 +111,7 @@ public class TechniqueDef implements Savable {
private List<ShaderNode> shaderNodes;
private ShaderGenerationInfo shaderGenerationInfo;
private boolean noRender = false;
private RenderState renderState;
private RenderState forcedRenderState;
@ -220,6 +221,28 @@ public class TechniqueDef implements Savable {
this.renderState = renderState;
}
/**
* Sets if this technique should not be used to render.
*
* @param noRender not render or render ?
*
* @see NoRender
*/
public void setNoRender(boolean noRender) {
this.noRender = noRender;
}
/**
* Returns true if this technique should not be used to render.
* (eg. to not render a material with default technique)
*
* @return true if this technique should not be rendered, false otherwise.
*
*/
public boolean isNoRender(){
return noRender;
}
/**
* @deprecated jME3 always requires shaders now
*/
@ -467,6 +490,7 @@ public class TechniqueDef implements Savable {
oc.write(lightMode, "lightMode", LightMode.Disable);
oc.write(shadowMode, "shadowMode", ShadowMode.Disable);
oc.write(renderState, "renderState", null);
oc.write(noRender, "noRender", false);
oc.write(usesNodes, "usesNodes", false);
oc.writeSavableArrayList((ArrayList)shaderNodes,"shaderNodes", null);
oc.write(shaderGenerationInfo, "shaderGenerationInfo", null);
@ -489,6 +513,7 @@ public class TechniqueDef implements Savable {
lightMode = ic.readEnum("lightMode", LightMode.class, LightMode.Disable);
shadowMode = ic.readEnum("shadowMode", ShadowMode.class, ShadowMode.Disable);
renderState = (RenderState) ic.readSavable("renderState", null);
noRender = ic.readBoolean("noRender", false);
if (ic.getSavableVersion(TechniqueDef.class) == 0) {
// Old version

@ -119,19 +119,6 @@ public class BatchNode extends GeometryGroupNode {
setNeedsFullRebatch(true);
}
@Override
public void updateGeometricState() {
if (!children.isEmpty()) {
for (Batch batch : batches.getArray()) {
if (batch.needMeshUpdate) {
batch.geometry.updateModelBound();
batch.geometry.updateWorldBound();
batch.needMeshUpdate = false;
}
}
}
super.updateGeometricState();
}
protected Matrix4f getTransformMatrix(Geometry g){
return g.cachedWorldMat;
@ -169,7 +156,7 @@ public class BatchNode extends GeometryGroupNode {
nvb.updateData(normBuf);
batch.needMeshUpdate = true;
batch.geometry.updateModelBound();
}
}
@ -234,7 +221,7 @@ public class BatchNode extends GeometryGroupNode {
batch.geometry.setMesh(m);
batch.geometry.getMesh().updateCounts();
batch.geometry.getMesh().updateBound();
batch.geometry.updateModelBound();
batches.add(batch);
}
if (batches.size() > 0) {
@ -748,7 +735,6 @@ public class BatchNode extends GeometryGroupNode {
}
}
Geometry geometry;
boolean needMeshUpdate = false;
}
protected void setNeedsFullRebatch(boolean needsFullRebatch) {

@ -459,7 +459,7 @@ public abstract class AbstractShadowRenderer implements SceneProcessor, Savable
debug = true;
}
abstract void getReceivers(GeometryList lightReceivers);
protected abstract void getReceivers(GeometryList lightReceivers);
public void postFrame(FrameBuffer out) {
if (skipPostPass) {

@ -192,7 +192,7 @@ public class DirectionalLightShadowRenderer extends AbstractShadowRenderer {
}
@Override
void getReceivers(GeometryList lightReceivers) {
protected void getReceivers(GeometryList lightReceivers) {
if (lightReceivers.size()==0) {
for (Spatial scene : viewPort.getScenes()) {
ShadowUtil.getGeometriesInCamFrustum(scene, viewPort.getCamera(), RenderQueue.ShadowMode.Receive, lightReceivers);

@ -139,7 +139,7 @@ public class PointLightShadowRenderer extends AbstractShadowRenderer {
}
@Override
void getReceivers(GeometryList lightReceivers) {
protected void getReceivers(GeometryList lightReceivers) {
lightReceivers.clear();
for (Spatial scene : viewPort.getScenes()) {
ShadowUtil.getLitGeometriesInViewPort(scene, viewPort.getCamera(), shadowCams, RenderQueue.ShadowMode.Receive, lightReceivers);

@ -151,7 +151,7 @@ public class SpotLightShadowRenderer extends AbstractShadowRenderer {
}
@Override
void getReceivers(GeometryList lightReceivers) {
protected void getReceivers(GeometryList lightReceivers) {
lightReceivers.clear();
Camera[] cameras = new Camera[1];
cameras[0] = shadowCam;

@ -612,9 +612,9 @@ public class TangentBinormalGenerator {
normal.normalizeLocal();
return new TriangleData(
tangent,
binormal,
normal);
tangent.clone(),
binormal.clone(),
normal.clone());
} finally {
tmp.release();
}

@ -454,6 +454,8 @@ public class J3MLoader implements AssetLoader {
if (isUseNodes) {
nodesLoaderDelegate.readFragmentShaderNodes(statement.getContents());
}
} else if (split[0].equals("NoRender")) {
technique.setNoRender(true);
} else {
throw new MatParseException(null, split[0], statement);
}

Loading…
Cancel
Save