Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. Maybe like this? decal:SetRotation(player:GetRotation())
  2. Also geometry made by the gs won't cast shadows, and doesn't have an aabb of it's own, cant be picked or have any api back to you application since the geometry is all made after leadwerks has sendt everything to the render pipline.
  3. This was just a modified diffuse.shader, paste this in the geometry tab, and you need to edit the vertex shader so the out variables are named g_... No control or evaluation shader are used. Just : Vertex->Geometry->Frag
  4. Here is a simple copy and offset geoemtry shader: #version 400 #define MAX_INSTANCES 256 layout(triangles) in; layout (triangle_strip, max_vertices=6) out; //in a triangle are 3 verts, + 3 for the copy.. //all these are outs from the vertex shader: in vec4 g_ex_color[]; in vec2 g_ex_texcoords0[]; in float g_ex_selectionstate[]; in vec3 g_ex_VertexCameraPosition[]; in vec3 g_ex_normal[]; in vec3 g_ex_tangent[]; in vec3 g_ex_binormal[]; in float g_clipdistance0[]; in vec4 g_modelvertexposition[]; //these goes into the fragment shader: out vec4 ex_color; out vec2 ex_texcoords0; out float ex_selectionstate; out vec3 ex_VertexCameraPosition; out vec3 ex_normal; out vec3 ex_tangent; out vec3 ex_binormal; out float clipdistance0; uniform mat4 projectioncameramatrix; void main() { //Just pass everything as is.. draw the original: for(int i = 0; i < gl_in.length(); i++) { gl_Position = gl_in[i].gl_Position; ex_color=g_ex_color[i]; ex_texcoords0=g_ex_texcoords0[i]; ex_selectionstate=g_ex_selectionstate[i]; ex_VertexCameraPosition=g_ex_VertexCameraPosition[i]; ex_normal=g_ex_normal[i]; ex_tangent=g_ex_tangent[i]; ex_binormal=g_ex_binormal[i]; clipdistance0=g_clipdistance0[i]; // done with the vertex EmitVertex(); } EndPrimitive(); //And now, make a copy and offset it a bit : for(int i = 0; i < gl_in.length(); i++) { vec4 offset=vec4(3,3,3,0); gl_Position = projectioncameramatrix*(g_modelvertexposition[i]+offset); ex_color=g_ex_color[i]; ex_texcoords0=g_ex_texcoords0[i]; ex_selectionstate=g_ex_selectionstate[i]; ex_VertexCameraPosition=g_ex_VertexCameraPosition[i]; ex_normal=g_ex_normal[i]; ex_tangent=g_ex_tangent[i]; ex_binormal=g_ex_binormal[i]; clipdistance0=g_clipdistance0[i]; // done with the vertex EmitVertex(); } EndPrimitive(); }
  5. yes, but you don't really need to declare anything in a table like that. just table.insert when needed I guess. (I don't know whats next in line in the js script :-) )
  6. I believe corners is declared as a array of 4 vec3 values. I think you only need to do this in lua: corners = { }
  7. What mack says works for me too. You are missing a trunk material, but collisions works fine to mee to when using macklebees method. I used a cyclinder as collsionmesh.
  8. If you open it in the model editor and click View->Show Physics, do you se a collion mesh?, if not just make one and save it. Either way this will be a guessing game unless you provide the tree for us to look at.
  9. Because you don't want anything to collide into them?
  10. Yes this doesn't work, so probably a bug yes. If you want a quick workaround you can add this to fpsplayer.lua Script.name="fpsplayer" And change your code in DeathTrigger to: if entity.script.name~=nil and entity.script.name == "fpsplayer" then
  11. I think you need to email support (at) leadwerks.com to get your key converted to steam.
  12. What is the output if you add to the top of the function: System:Print(entity:GetClassName().." - "..entity:GetKeyValue("name"))
  13. Here are some sites to get inspiration, I use alot : https://www.shadertoy.com/ http://glslsandbox.com/ http://shaderfrog.com/app
  14. 1. Just get it through greenlight. 2. Publishing standalone encrypts data.zip already.
  15. Very nice and well done article
  16. Another with vegetation, youtube ruins it with their compression on gray overcast rainy weather
  17. Your texture fades/blurs using alpha. You should then blend alpha not light. If you want to blend light the laser should be on a black background instead of alpha.
  18. That would depend on what you already know about them, however since all engine has it's own way of doing shading I'd say generic tutorials aren't directly applicable in Leadwerks (or any other engine for that matter, they all have different input, output, uniform naming to the shader). So my answer to this is always, learn by doing, modify extisting shaders (what I did). Model fragment shaders are the simplest ones to mod, and since Leadwerks is a deferred engine, you don't have to worry about lightning.
  19. The rain map is pure 2d post process using cameramatrix rotation to determine it's direction / looking up/down. It's pretty much this one : http://glslsandbox.com/e#28930.0 However I sample positions (depth) to do fresnel to fake everything a wet look and normals to make rain "run" down along curves of stuff.
  20. It's no bug it's just there is no original source file like .png/.jpg/.bmp for this tex file (it's a default LE asset), hence you can't do changes to it. If you contact Josh maybe he will supply the source image file for you.
  21. Context class is doucumented in the API with examples. But there is not a GUI a gui tutorial I'm afraid. http://www.leadwerks.com/werkspace/page/api-reference/_/context/
×
×
  • Create New...