Jump to content

Search the Community

Showing results for tags 'shader'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Beyond Civilization Blog Ext
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • xtreampb's Blog
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Marcousik's Creations Blog
  • EVE LBS Studio
  • Rendering puzzles
  • Screen Size Utility
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • Dave Lee's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • The progression......
  • Ultra Software Company Blog
  • The Progression
  • Pancake's Blog
  • Test Blog
  • BLaBZ Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Rachel's Dev-Blog
  • Eagle's Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • DigitalHax Blog
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • SavageDogg38's Blog
  • Built from Ruins
  • Remaining Days
  • test_external_blog
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Playing Online
  • Evayr's Blog
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Wedmer's Blog
  • Lockdown, going forward.
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Runenrise and more
  • reepblue's Blog
  • Slippy's Corner
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • Dwarf Beard
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Glushchenko Blog
  • Express Lab Games Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • UltraEngine - Experiences, add-ons and other Stuff
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • The Demurian Scribe
  • GUI Editor
  • GUI Tutorial
  • noob_shaders
  • The Seventh World
  • Phodex Games Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • The Blog of Yue
  • Snowboarding Development Blog
  • Ocean: Rendering in Leadwerks 4
  • Game Ready Maps
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • SALVATIONLAND
  • Blender tutorials
  • Usefull Scripts & Components
  • Thirsty Panther
  • Direct Macro

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons
    • Extensions & Plugins
    • Components
    • Addon Development
  • Platforms
    • Windows
    • Linux
    • macOS

Categories

  • Tutorials
  • Games
  • Work in Progress

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

  1. Does anyone know how to write tesselation shaders? I looked at the example, and was able to integrate it with my custom shader, but the control and evaluation shaders from diffuse-normal-specular-tess.shader doesn't really seem to do anything. I want to be able to take a triangle and subdivide it into an arbitrary amount of triangles. There seems to be a lack of tutorials online for tesselation shaders .
  2. Is it possible to render to a custom buffer for post-processing? (i.e., not the depth, normal, or diffuse buffers)
  3. Is there a way to set some kind of global uniform? I wanted to do some modifications to a vegetation shader to change with player movement (not camera movement).
  4. Hello. I spent several hours trying to work the shader, but I can not make it work: S I'm using as the standard test developer textures. With emissive material reflects. I have put the shader in postprocess. Where is the error? Thanks!
  5. I'm trying to make a cel shaded shader and am working on the outline part. Everything seems to work well except for this: http://steamcommunity.com/sharedfiles/filedetails/?id=603858840 It seems to me like the normals past a certain depth are not uniform and I'm not really sure why. Or is this just Nyquist-like effect? If so, what would be the best way to handle this? This is the shader I wrote (there's a simple lua script that binds the diffuse, depth and normal textures): #version 400 uniform sampler2D texture1; //diffuse uniform sampler2DMS texture2; //depth uniform sampler2DMS texture3; //normal uniform vec2 camerarange; uniform bool isbackbuffer; uniform vec2 buffersize; out vec4 fragData0; #define width 2 float DepthToZPosition(in float depth) { return camerarange.x / (camerarange.y - depth * (camerarange.y - camerarange.x)) * camerarange.y; } void main(void) { vec2 texcoord = gl_FragCoord.xy/buffersize + 0.5/(buffersize*0.5); if (isbackbuffer) texcoord.y = 1.0 - texcoord.y; vec4 c = texture(texture1, texcoord); //Line Detection bool edge = false; float depth = DepthToZPosition(texelFetch(texture2,ivec2(texcoord*buffersize),0).x); float depth_temp = 0; vec3 normal = texelFetch(texture3,ivec2(texcoord*buffersize),0).xyz; normal=normal/length(normal); vec3 normal_temp = vec3(0); // Check adjacent pixels for (int x=-1; x<2; x+=2) for (int y=-1; y<2; y+=2) { depth_temp = DepthToZPosition(texelFetch(texture2,ivec2(texcoord*buffersize)+ivec2(x*width,y*width),0).x); normal_temp = texelFetch(texture3,ivec2(texcoord*buffersize)+ivec2(x*width,y*width),0).xyz; normal_temp = normal_temp/length(normal_temp); if ((abs(dot(normal_temp,normal)) < 1) && (abs(depth_temp-depth) > .1)) { edge = true; } } fragData0 = c; if (edge) { fragData0 = vec4(0,0,0,c.a); } }
  6. Hello! I'm trying to apply a material to a sprite, but the texture does not look the same on the material and by itself. Here is a difference: As you can see, the material somehow ignores/destroys the blurry aspect of the texture and gives it straight edges. I'm using the Editor/sprite.shader. Is there a way to keep the blur of the texture when the latter is applied to a material. Thank you! P.S. Here are material settings:
  7. Hello, sorry I'm new to this. I was testing some things of the engine and tried to add the tessellation shader but I can't make it work. I get the example from this page: "Pass the tessellation, please!" I unzipped the file and folder extracted in the engine. After i add an object as a material the "PassThrough.mat" and gives me an error and editor closes. What can I do? Thank you
  8. It would be very nice if there are Shaders like this: http://gamedev.stackexchange.com/questions/14350/shader-effect-similar-to-metro-2033-gasmask Or just more shaders that make your game look more realistic considering these kind of shaders. In the example of the link there are parts that can be set up just like the blood overlay in the fpsplayer but I dont want to learn all basics of shading integration into leadwerks for months just to import a (kind of) simple shader that just makes the Mask effect. I posted an attempt of mine here ( exapmle ), use it freely.
  9. Hello! I have this minimalistic quad model: local model = Model:Create() local surface = model:AddSurface() surface:AddVertex(-0.5,-0.5,0, 0,0,-1, 0,0) surface:AddVertex(0.5,-0.5,0, 0,0,-1, 1,0) surface:AddVertex(0.5,0.5,0, 0,0,-1, 1,1) surface:AddVertex(-0.5,0.5,0, 0,0,-1, 0,1) surface:AddTriangle(2,1,0) surface:AddTriangle(0,3,2) surface:UpdateAABB() model:UpdateAABB(Entity.LocalAABB) model:UpdateAABB(Entity.GlobalAABB) In order to shade it, I create a simple material and give it my custom minimalistic shader. Here is the vertex shader #version 400 #define MAX_INSTANCES 256 //Uniforms uniform instancematrices { mat4 matrix[MAX_INSTANCES];} entity; uniform mat4 projectioncameramatrix; //Attributes in vec3 vertex_position; void main() { mat4 entitymatrix = entity.matrix[gl_InstanceID]; mat4 entitymatrix_ = entitymatrix; entitymatrix_[0][3]=0.0; entitymatrix_[1][3]=0.0; entitymatrix_[2][3]=0.0; entitymatrix_[3][3]=1.0; vec4 modelvertexposition = entitymatrix_ * vec4(vertex_position, 1.0); gl_Position = projectioncameramatrix * modelvertexposition; } And here is the fragment shader #version 400 // Outputs out vec4 fragData0; void main() { fragData0 = vec4(0.0, 0.0, 0.0, 1.0); } Now, you should notice that I do not give any special color to the model, material or vertices, and that I set fragData0 to black, so normally, it should be black (and since the background is black also, it should be invisible in this particular case). However, it is red: If I change the relevant line of code to, e.g. fragData0 = vec4(0.0, 1.0, 0.0, 1.0); I get a greenish mix of green and red: Or with fragData0 = vec4(0.0, 0.0, 1.0, 1.0); I get purple, as expected... How can I get rid of this basic red tint? Why is it there in the first place? Thank you!
  10. I'm trying to get motion-blur working for my game, but I'm having a little trouble because I'm stuck at the most important part. Does anyone know how to get the previous screen? I imagine that there needs to be some sort of texture storage in the Lua post-process file, but I'm not really sure how to do this.
  11. Hi, Is there a material to create a block of static or animated water in a tub? I have not found it
  12. I am having problems with getting a couple of shader's to work in leadwerks, uh there just not working, I am not sure if it is just my side or if they just don't work. (as they work in shadertool) one of them is a edge glow and the other is a fullscreen fake 3d shader(http://steamcommunity.com/sharedfiles/filedetails/?id=353301645) to use for my menu, be great for any help. EdgeGlow.zip
  13. Hello. I would like to apply the same effect to the pipes created in Leadwerks, however, changing in real time the flow direction and pause it when necessary (start/stop/inverse flux command). There is already a LUA script dedicated to this task? Thanks in advance for reply
  14. Hi all! I'm wanting to create a motion blur effect on the player entity. I'm wondering how to go about this as the camera follows the player: so overlaying the previous rendered image probably wont work, as the player is always center screen. I'm guessing I could go about achieving the effect by creating a shader which duplicates the diffuse texture of the player entity and stretches it across the screen, and/or duplicates it across the screen with a fade on the alpha. I'm just getting started with shaders, and creating effects such as this, so I'm hoping someone can offer some advice or tips. Many thanks in advance!
  15. http://www.leadwerks.com/werkspace/topic/1228-ssdo-filter/page__hl__ssdo+filter Here is a sample of a SSDO shader.that seems to work (?) For me as non-programmer it's a skinned bone to chew on, because I have no idea what to do with this piece of code and where to put it or as what to save it etc. A step by step how to go about it would be nice. cheers
  16. hello, i need a simple water effect (without scene mirrror). today i try some shader sources from web but nothing work :-( i saw there are some special tags in .shader file beginning with @ for the main shader code. i move my examples here and there but nothing happens. have someone a water.shader file for me please?
  17. I found this shader in the Leadwerks shader folder: diffuse+normal+specular+env.shader Anyway, I am assuming this shader is sort of like a reflection shader, but I can't get it to display. Has anyone used this shader before for a material? If so, do you know what texture slots should be filled with what?
  18. Flag shader with some controls : Install: unzip into project root Drag Prefabs/Flag/LEFlag into scene Adjustables: In scene/script tab Wind Frequency Wobble SpeedFactor You can easily swap out the flag model with something more exciting than mine. Pics shows when wind is 0.5 and 1.0 flag.zip
  19. When I apply a material to one of the imported models, the models stop being displayed in the Textured+Lighting render mode. I've tried this on my own machine and one of my colleague's, and the issue is reproducible. Additionally, it would seem any characters that have a face rig get deformed when in Textured+Lightning render. Is threre any reason why this might happen?
  20. I'm using the default grayscale posteffect shader to make everything black and white, but this doesn't affect anything drawn during Script:PostRender(context) (eg, red text is still red). Is it possible to make a shader apply after drawing takes place? Or any solution easier than manually changing the colour/textures of GUI elements - ideally more advanced shaders could also be used. This script shows my problem. You can put this script on any entity and link it to a camera, you will see everything is greyscale except the text 'Always red'. Script.Camera = nil --entity "Camera" Script.Enabled = true --bool "Enabled" function Script:Start() self.WasEnabled = -1 end function Script:_Enable() self.Camera:AddPostEffect("Shaders/PostEffects/grayscale.shader") end function Script:_Disable() self.Camera:ClearPostEffects() end function Script:UpdateWorld() if self.Enabled~=self.WasEnabled then if self.Enabled then self:_Enable() else self._Disable() end end self.WasEnabled = self.Enabled end function Script:PostRender(context) context:SetBlendMode(Blend.Solid) context:SetColor(1,0,0,1) context:DrawText("Always red", 5, 5) end EDIT: Right after posting this I found context:SetShader, it sounds like what I want. And the forum ruined my code indentation
  21. Hi everyone. I was wondering if someone could take a look at these modified versions of Shadmars Vegetation+Diffuse+Shadowmask and Shadow+Vegetation shaders to check for any errors. Also I was wondering if there is a way I can make the vegetation sway only when it is visible and/or within a certain distance from the camera. That could be really useful (especially if it increases my fps). Anyways here they are. They compile without any errors and seem to work fine. Feel free to use them in any of your own projects at your own risk until they get a stamp of approval. Vegetation+Diffuse+Shadowmask Shader-- Fragment- #version 400 #define BFN_ENABLED 1 //Uniforms uniform sampler2D texture0;//diffuse map uniform sampler2D texture1;//normal map uniform vec4 materialcolorspecular; uniform vec4 lighting_ambient; uniform samplerCube texture15; uniform vec2 camerarange; uniform vec2 buffersize; uniform float camerazoom; //Inputs in vec2 ex_texcoords0; in vec4 ex_color; in float ex_selectionstate; in vec3 ex_VertexCameraPosition; in vec3 ex_normal; in vec3 ex_tangent; in vec3 ex_binormal; //Outputs out vec4 fragData0; out vec4 fragData1; out vec4 fragData2; out vec4 fragData3; float DepthToZPosition(in float depth) { return camerarange.x / (camerarange.y - depth * (camerarange.y - camerarange.x)) * camerarange.y; } void main(void) { vec4 outcolor = ex_color; outcolor *= texture(texture0,ex_texcoords0); if (outcolor.a < .63) discard; vec4 color_specular = materialcolorspecular; vec3 screencoord = vec3(((gl_FragCoord.x/buffersize.x)-0.5) * 2.0 * (buffersize.x/buffersize.y),((-gl_FragCoord.y/buffersize.y)+0.5) * 2.0,DepthToZPosition( gl_FragCoord.z )); screencoord.x *= screencoord.z / camerazoom; screencoord.y *= -screencoord.z / camerazoom; vec3 nscreencoord = normalize(screencoord); vec3 normal = ex_normal; normal = texture(texture1,ex_texcoords0).xyz * 2.0 - 1.0; float ao = normal.z; normal = ex_tangent*normal.x + ex_binormal*normal.y + ex_normal*normal.z; normal=normalize(normal); vec4 lighting_diffuse = vec4(0); vec4 lighting_specular = vec4(0); float attenuation=1.0; vec3 lightdir; vec3 lightreflection; int i; float anglecos; float diffspotangle; float denom; fragData0 = outcolor; #if BFN_ENABLED==1 fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z))); #else fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a); #endif fragData1.a = color_specular.r * 0.299 + color_specular.g * 0.587 + color_specular.b * 0.114; int materialflags=1; if (ex_selectionstate>0.0) materialflags += 2; fragData2 = vec4(0.0,0.0,0.0,materialflags/255.0); } -Vertex #version 400 #define MAX_INSTANCES 256 //Uniforms uniform vec4 materialcolordiffuse; uniform mat4 projectioncameramatrix; uniform mat4 camerainversematrix; uniform instancematrices { mat4 matrix[MAX_INSTANCES];} entity; uniform float currenttime;//Attributes in vec3 vertex_position; in vec4 vertex_color; in vec2 vertex_texcoords0; in vec3 vertex_normal; in vec3 vertex_binormal; in vec3 vertex_tangent; //Outputs 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;void main() { mat4 entitymatrix = entity.matrix[gl_InstanceID]; mat4 entitymatrix_=entitymatrix; entitymatrix_[0][3]=0.0; entitymatrix_[1][3]=0.0; entitymatrix_[2][3]=0.0; entitymatrix_[3][3]=1.0; //SWAY float seed = mod(currenttime / 100.0 * 0.25,360.0); seed += entitymatrix_[3].x*33.0 + entitymatrix_[3].y*67.8 + entitymatrix_[3].z*123.5; seed += vertex_position.x + vertex_position.y + vertex_position.z; vec4 movement = vec4( vec3( 0.02 * (sin(seed)+0.025*cos(seed*5.2+3.2)) ),0.0); vec4 modelvertexposition = entitymatrix_ * vec4(vertex_position+movement.xyz,1.0); ex_VertexCameraPosition = vec3(camerainversematrix * modelvertexposition); gl_Position = projectioncameramatrix * modelvertexposition; mat3 nmat = mat3(camerainversematrix[0].xyz,camerainversematrix[1].xyz,camerainversematrix[2].xyz); nmat = nmat * mat3(entitymatrix[0].xyz,entitymatrix[1].xyz,entitymatrix[2].xyz); ex_normal = normalize(nmat * vertex_normal); ex_tangent = normalize(nmat * vertex_tangent); ex_binormal = normalize(nmat * vertex_binormal); ex_texcoords0 = vertex_texcoords0; ex_color = vec4(entitymatrix[0][3],entitymatrix[1][3],entitymatrix[2][3],entitymatrix[3][3]); //If an object is selected, 10 is subtracted from the alpha color. //This is a bit of a hack that packs a per-object boolean into the alpha value. ex_selectionstate = 0.0; if (ex_color.a<-5.0) { ex_color.a += 10.0; ex_selectionstate = 1.0; } ex_color *= vec4(1.0-vertex_color.r,1.0-vertex_color.g,1.0-vertex_color.b,vertex_color.a) * materialcolordiffuse; } Shadow+Vegetation Shader-- Fragment- #version 400 uniform sampler2D texture4;in vec2 ex_texcoords0; void main() { if (texture(texture4,ex_texcoords0).a < 0.8) discard; } Vertex- #version 400 #define MAX_INSTANCES 256 //Uniforms //uniform mat4 entitymatrix; uniform mat4 projectioncameramatrix; uniform instancematrices { mat4 matrix[MAX_INSTANCES];} entity; uniform float currenttime; //Attributes in vec3 vertex_position; in vec2 vertex_texcoords0; out vec2 ex_texcoords0; void main() { mat4 entitymatrix = entity.matrix[gl_InstanceID]; mat4 entitymatrix_=entitymatrix; entitymatrix_[0][3]=0.0; entitymatrix_[1][3]=0.0; entitymatrix_[2][3]=0.0; entitymatrix_[3][3]=1.0; //SWAY float seed = mod(currenttime / 100.0 * 0.25,360.0); seed += entitymatrix_[3].x*33.0 + entitymatrix_[3].y*67.8 + entitymatrix_[3].z*123.5; seed += vertex_position.x + vertex_position.y + vertex_position.z; vec4 movement = vec4( vec3( 0.01 * (sin(seed)+0.025*cos(seed*5.2+3.2)) ),0.0); ex_texcoords0 = vertex_texcoords0; vec4 modelvertexposition = entitymatrix_ * vec4(vertex_position+movement.xyz,1.0); gl_Position = projectioncameramatrix * modelvertexposition; }
  22. Hello, I do work with Glowshaders in my Level. Is there a possibility, to make the Glow-Light fade in and fade out (Only texture 5)? Like a blinking Light. Great work by shadmar ... Glow Shader: http://www.leadwerks.com/werkspace/files/file/473-glowmapshaders-leadwerks31/ Might someone have a hint to me for that purpose? C.U. R.E.Z.
  23. Hey guys, I'm trying to get the shader for adjusting plane clipping values at runtime. When I do: Material* Mat = terrain->GetMaterial(); I get a null reference What's the correct way of doing that? Also, adding the terrain object to the documentation would be awesome
  24. Hi, is it possible to use the depthbuffer for postprocessing effects? I looked at all the existing postprocessing shaders and saw, all of them only use the color-texture, which is retrieved by uniform sampler2D texture1; I also found, that texture2 contains some kind of a cobblestone texture but all the other slots seem to be empty. Also I saw, it is possible to push a Vec4 Uniform to the shader by (C++): myShader->SetVec4("foo", Vec4(0,0, 1, 1)); (GLSL): uniform vec4 foo; but I didn't find any way of pushing an arbitrary texture as a uniform.
×
×
  • Create New...