Refined anime outline shader
This commit is contained in:
parent
e729c53e3c
commit
9c441a24c4
@ -22,7 +22,7 @@ void main(){
|
||||
vec4 outColor = vec4(0);
|
||||
|
||||
if(val == 1){
|
||||
outColor = vec4(0,0,0,1);
|
||||
outColor = vec4(0,0,0,0.5);
|
||||
// outColor.a = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -696,6 +696,7 @@ public class LoadingThread extends Thread {
|
||||
Entity campfire = EntityUtils.spawnDrawableEntity("Models/campfire1.fbx");
|
||||
EntityUtils.getPosition(campfire).set(1,0,1);
|
||||
EntityUtils.getRotation(campfire).rotationX(-(float)Math.PI/2.0f);
|
||||
campfire.putData(EntityDataStrings.DRAW_OUTLINE, true);
|
||||
|
||||
//flame
|
||||
Entity cube = EntityUtils.spawnDrawableEntity("Models/flame1.fbx");
|
||||
|
||||
@ -141,6 +141,19 @@ public class AssetManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Nuclear function, reloads all shaders loaded into memory
|
||||
*/
|
||||
public void forceReloadAllModels(){
|
||||
for(String modelKey : modelsLoadedIntoMemory.keySet()){
|
||||
if(modelKey.contains("Models")){
|
||||
modelsInQueue.add(modelKey);
|
||||
modelsLoadedIntoMemory.remove(modelKey);
|
||||
}
|
||||
}
|
||||
// modelsLoadedIntoMemory.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -582,9 +582,21 @@ public class MenuGenerators {
|
||||
return false;
|
||||
}});
|
||||
|
||||
//reload all models
|
||||
Button reloadModelButton = new Button();
|
||||
Label reloadModelLabel = new Label(100,450,fontSize);
|
||||
reloadModelLabel.setText("Reload all models");
|
||||
reloadModelButton.addChild(reloadModelLabel);
|
||||
scrollable.addChild(reloadModelButton);
|
||||
reloadModelButton.setOnClick(new ClickableElement.ClickEventCallback(){public boolean execute(ClickEvent event){
|
||||
// Main.running = false;
|
||||
Globals.assetManager.forceReloadAllModels();
|
||||
return false;
|
||||
}});
|
||||
|
||||
//disable drawing player character
|
||||
Button toggleDrawPlayerButton = new Button();
|
||||
Label toggleDrawPlayerLabel = new Label(100,450,fontSize);
|
||||
Label toggleDrawPlayerLabel = new Label(100,550,fontSize);
|
||||
toggleDrawPlayerLabel.setText("Toggle draw character");
|
||||
toggleDrawPlayerButton.addChild(toggleDrawPlayerLabel);
|
||||
scrollable.addChild(toggleDrawPlayerButton);
|
||||
@ -603,9 +615,9 @@ public class MenuGenerators {
|
||||
return false;
|
||||
}});
|
||||
|
||||
for(int i = 0; i < 7; i++){
|
||||
for(int i = 0; i < 6; i++){
|
||||
Button someButton = new Button();
|
||||
Label someLabel = new Label(100,550 + i * 100,fontSize);
|
||||
Label someLabel = new Label(100,650 + i * 100,fontSize);
|
||||
someLabel.setText("aaaaaa" + i);
|
||||
someButton.addChild(someLabel);
|
||||
scrollable.addChild(someButton);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package electrosphere.renderer.ui;
|
||||
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.main.Globals;
|
||||
import electrosphere.renderer.Material;
|
||||
import electrosphere.renderer.Model;
|
||||
@ -67,12 +68,16 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
|
||||
Globals.renderingEngine.setViewportSize(parentWidth, parentHeight);
|
||||
|
||||
Model planeModel = Globals.assetManager.fetchModel(Globals.planeModelID);
|
||||
planeModel.pushUniformToMesh("plane", "mPosition", boxPosition);
|
||||
planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions);
|
||||
planeModel.pushUniformToMesh("plane", "tPosition", texPosition);
|
||||
planeModel.pushUniformToMesh("plane", "tDimension", texScale);
|
||||
planeModel.meshes.get(0).setMaterial(customMat);
|
||||
planeModel.drawUI();
|
||||
if(planeModel != null){
|
||||
planeModel.pushUniformToMesh("plane", "mPosition", boxPosition);
|
||||
planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions);
|
||||
planeModel.pushUniformToMesh("plane", "tPosition", texPosition);
|
||||
planeModel.pushUniformToMesh("plane", "tDimension", texScale);
|
||||
planeModel.meshes.get(0).setMaterial(customMat);
|
||||
planeModel.drawUI();
|
||||
} else {
|
||||
LoggerInterface.loggerRenderer.ERROR("Window unable to find plane model!!", new Exception());
|
||||
}
|
||||
}
|
||||
|
||||
public void pack() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package electrosphere.renderer.ui.elements;
|
||||
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.main.Globals;
|
||||
import electrosphere.renderer.Material;
|
||||
import electrosphere.renderer.Model;
|
||||
@ -88,12 +89,16 @@ public class ImagePanel implements DrawableElement, DraggableElement {
|
||||
Vector3f boxDimensions = new Vector3f(ndcWidth,ndcHeight,0);
|
||||
|
||||
Model planeModel = Globals.assetManager.fetchModel(imagePanelModelPath);
|
||||
planeModel.pushUniformToMesh("plane", "mPosition", boxPosition);
|
||||
planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions);
|
||||
planeModel.pushUniformToMesh("plane", "tPosition", texPosition);
|
||||
planeModel.pushUniformToMesh("plane", "tDimension", texScale);
|
||||
planeModel.meshes.get(0).setMaterial(customMat);
|
||||
planeModel.drawUI();
|
||||
if(planeModel != null){
|
||||
planeModel.pushUniformToMesh("plane", "mPosition", boxPosition);
|
||||
planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions);
|
||||
planeModel.pushUniformToMesh("plane", "tPosition", texPosition);
|
||||
planeModel.pushUniformToMesh("plane", "tDimension", texScale);
|
||||
planeModel.meshes.get(0).setMaterial(customMat);
|
||||
planeModel.drawUI();
|
||||
} else {
|
||||
LoggerInterface.loggerRenderer.ERROR("Image Panel unable to find plane model!!", new Exception());
|
||||
}
|
||||
}
|
||||
|
||||
public int width = 1;
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import org.joml.Vector2f;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import electrosphere.logger.LoggerInterface;
|
||||
import electrosphere.main.Globals;
|
||||
import electrosphere.renderer.Material;
|
||||
import electrosphere.renderer.Model;
|
||||
@ -260,12 +261,16 @@ public class ScrollableContainer implements DrawableElement, ContainerElement {
|
||||
Globals.renderingEngine.setViewportSize(parentWidth, parentHeight);
|
||||
|
||||
Model planeModel = Globals.assetManager.fetchModel(Globals.planeModelID);
|
||||
planeModel.pushUniformToMesh("plane", "mPosition", boxPosition);
|
||||
planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions);
|
||||
planeModel.pushUniformToMesh("plane", "tPosition", texPosition);
|
||||
planeModel.pushUniformToMesh("plane", "tDimension", texScale);
|
||||
planeModel.meshes.get(0).setMaterial(customMat);
|
||||
planeModel.drawUI();
|
||||
if(planeModel != null){
|
||||
planeModel.pushUniformToMesh("plane", "mPosition", boxPosition);
|
||||
planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions);
|
||||
planeModel.pushUniformToMesh("plane", "tPosition", texPosition);
|
||||
planeModel.pushUniformToMesh("plane", "tDimension", texScale);
|
||||
planeModel.meshes.get(0).setMaterial(customMat);
|
||||
planeModel.drawUI();
|
||||
} else {
|
||||
LoggerInterface.loggerRenderer.ERROR("ScrollableContainer unable to find plane model!!", new Exception());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user