Jump to content

Search the Community

Showing results for tags 'glsl'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Models
    • Animals
    • Barriers
    • Characters
    • Containers
    • Environments
    • Furniture
    • Props
    • Rocks
    • Vegetation
    • Vehicles
    • Weapons
  • Materials
    • Brick
    • Cartoon
    • Decals
    • Dirt
    • Grass
    • Industrial
    • Medieval
    • Metal
    • Plastic
    • Plaster
    • Rock
    • SciFi
    • Sky
    • Signs
    • Tile
    • Stone
    • Walls
    • Wood
  • Plugins
  • Scripts
    • GUI
    • Object
    • Utilities
  • Shaders
    • Post-Processing Effects
    • Surface
  • Sounds
    • Ambience
    • Effects
    • Music
  • Tools
  • BATTLE LEAGUE's Assets


There are no results to display.

There are no results to display.


  • Leadwerks
    • Technical Assistance
    • General Discussion
    • Programming
    • Game Art
    • Suggestion Box
    • Bug Reports
  • Platforms
    • Windows
    • Linux
    • OSX
  • Community
    • Showcase
    • Promotion
    • Off-topic
  • Arena Shooter's Forum
  • BATTLE LEAGUE's Topics
  • Away from Home's Zone Script
  • Away from Home's General
  • Away from Home's Zone Rigging / Modeling
  • Vec-Tec's Releases
  • Vec-Tec's Topics
  • Forth's Development
  • Forth's Game design
  • Forth's Graphics
  • Forth's Documentation
  • Forth's TODO
  • Forth's IMPORTANT
  • Forth's Screenshots
  • The uncertain world's Game Design
  • The uncertain world's Programming
  • The uncertain world's TODO
  • The uncertain world's Graphics
  • The uncertain world's Screenshots
  • Dark Age Mist's Videos

Product Groups

  • Leadwerks
  • Model Packs
  • Gear

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Found 29 results

  1. As well as trying out texture atlases I'm looking into textures arrays too, but am having trouble finding information on how to set it up. This is what I have so far; Material* mat = Material::Load("Materials\\terrain.mat"); Texture* texture = Texture::Load("Terrain\\beach_dirt_b.tex"); OpenGLShader* shader = (OpenGLShader*)mat->GetShader(); int _width = texture->GetWidth(), _height = texture->GetHeight(); char* buf = new char[texture->GetMipmapSize(0) * 4]; texture->GetPixels(buf); glUseProgram(shader->program); GLuint _buffer; glGenTextures(1, &_buffer); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D_ARRAY, _buffer); glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, _width, _height, 1); glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, _width, _height, 1, GL_RGBA8, GL_BYTE, buf); Part of the Fragment Shader; #version 430 layout (binding = 0) uniform sampler2DArray tex; //in main() outcolor = texture(tex, vec3(coords.x, coords.y, 0)); All I get is total blackness on the terrain. Wondering if any of you guys know how to implement this? If needed I can make a small test program and upload that. A link I used; https://ferransole.wordpress.com/2014/06/09/array-textures/
  2. I'm currently trying to write a shader that makes every triangle of the mesh point to the position of the camera regardless of the camera's rotation. I think I can multiply the vertex positions in the vertex shader by a one of the matrices but I'm not sure which one or how. And I think the camera matrix will rotate the triangle to the same orientation as the camera and not just point to it's position? Basically I need the vertex shader (or geometry if it's easier) to do what Entity::Point() does but on each triangle and not the mesh as a whole. Anyone got any ideas on how to do this? 🤔 EDIT : I've been getting the direction the camera like this; normalize(vsModelVertexPosition.xyz - cameraposition)
  3. I'm looking for someone to write a terrain shader that will texture a terrain model based on height and slope. I want it to use uniforms for the height and slope of each layer so I can change them through code. It will need to use at least four layers - each with diffuse, normal and specular maps. If it can use more layers that would be better. Also I would like the option to use an alpha map to further control where textures are shown. The terrain is a cube, pictured below; Would like it by the end of the month if possible. Will pay for the work too. PM me if interested.
  4. I've put together a quick shader that will show the object in wire-frame and draw lines to show the direction of each vertex normal. But the normal's don't seem to be acting correctly. Is somehow able to show me what I'm doing wrong? I have a feeling it something to do with the cameraprojection matrix, but unsure how to fix it. I used the info from this site; http://www.geeks3d.com/20130905/exploring-glsl-normal-visualizer-with-geometry-shaders-shader-library/ diffuse_shownormals.zip
  5. I've taken a look at the terrain.shader that comes with Leadwerks to see if I can modify it to my needs, but I'm not sure where to start. What I want is to texture a grid mesh of a terrain with multiple textures based and height and slope, and maybe even an alpha map. If someone is able to point me in the right direction or even a small snippet of code that shows how the height and slope can change where a texture is shown I'd appreciate it. Thanks.
  6. I'm currently trying to subdivide a triangle in the geometry shader. I put the material using the shader on a plane made from two triangles. However it seems that the coordinates in GLSL are different to that in Leadwerks? That the positive X axis in Leadwerks is actually the negative X axis in the shader. And the same for the Z axis. The Y axis seems fine. I want the shader to turn the plane of two triangles into a more detailed grid for a terrain. I know the shader works on each triangle, so I will have to divide each triangle itself into the appropriate triangles so that the end result in game looks like a uniform grid. I've thought of tessellation but I don't think it'll give me the results I'm looking for. Any help with this is appreciated. Thanks.
  7. I am a bit of a GLSL noob. You are the experts so this is probably easy to answer. I want to draw a 2D color gradient (as part of the ui) on screen. Lets say I want the gradient to be drawn at x: 100 y:100 and have a with of 200 and a height 50. I guess I would have x, y, width and height as uniforms in my shader (I will figure out the rest of the glsl later on). Ok now for one of the questions. Should I use SetShader on Leadwerks::Context to apply my shader? Something like this: Leadwerks::Shader *myShader; Leadwerks::Context *context; ... myShader->SetInt("pos_x", 100); myShader->SetInt("pos_x", 100); myShader->SetInt("dim_width", 200); myShader->SetInt("dim_height", 50); context->SetShader(myShader); Another question is. Should I set the shader before or after world->Render(); My guess is after. And yes, I want to use a shader. Thank you for all the help I can get.
  8. 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
  9. I used the GLSL export plugin from Blender in order to use with the game engine as a material, but I can't seem to use it properly. I tried following the information provided by the Leadwerks wiki, but I'm not a programmer, so I don't know how to properly call the .vert and .frag files into Leadwerks. Any indication of what to do would be greatly appreciated! http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Game_Engine/Export_GLSL
  10. 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.
  11. Hello! I think that you should add another thread specifically for tutorials. We can see that the community is growing in numbers daily, and we could use something like this. I feel like it would keep the General Discussion thread neater, and would make it easier for someone new to locate help (besides the default text documentation).
  12. I need to place large flat game objects (flat boxes), then drill about 3-5 holes straight through of various sizes and shape. Then later I need to resize/shape the holes. Can Leadwerks use CSG at gametime to accomplish this? Or a moveable object that simply subtracts an overlapping area from any object it intersects, and support for one object to be intersected by multiple subtractors. If so I'll buy immediately Thanks, -Idle
  13. When you want to add a texture parameter to a shader, there's no way to tell in the material editor which texture goes to which shader parameter without reading the code. The material editor should look at the shader code and look for comments on the same line that the sampler2D is declared. It could then take the name in that comment and put it in the material editor. Pretty simple feature, right? If you want to make it so that people didn't name a sampler2D in the material editor unintentionally, you could make it so that it requires syntax like: uniform sampler2D texture5; // @name Specular Power
  14. As you all may know i have played a lot with the postprocessing feature currently implemented in Leadwerks 3.1. I have to admit Josh was right with implementing them in a stack. But with everything which seems to be easy at first i found some issues which in my opinion need to be adressed. the glsl and lua shaders are nice, but i think a small envelope object for a postprocess might be needed. you can add additional information like a dictionary of shader or script variables which can be accessed and modified from outside [*]the AddPostProcess should at least return an index but better the previously mentioned envelope object together with an index. Add methods to add Posteffects at a specified index and AddFirst and AddLast Helps to manage posteffects which are essential to be rendered at first/last [*]Something which might be hard to maintain, but might be useful for workshop effects and others Add a global buffer dictionary maybe with some naming convention based on buffer usage, size and pixelformat Currently all posteffects with identical buffers would need to create them on their own which leads in unneeded rendering and texture memory [*]A general addition mostly related to (in my case) to posteffects would be a way to add layers of worlds to the editor, eg for volume fog primitives or water regions. Why? Currently the posteffects are nearly unmaintable either from code or from Editor. Without the usage of global tables where you save your variables there is no way to interact with the posteffects. Also with global tables as a variable store you rely on 3rd parties or you need to modify the posteffects on your own which might be a pain for non shader users and artists. This is what came into my mind when working with the post effects. I have some more additions in mind but these are the most important ones from my point of view. cheers klepto2
  15. I'm struggling even with a buddy already, on learning LUA. He's busy I dont like bothering him, so the next best thing would be to learn with some one strictly on learning coding or to be taught. Any body up for the task or want to learn together?
  16. hi guys me and my buddy are working on a game which will be a survival horror and we have been trying to figure out how to attach a model of a flashlight to our fps controller so the arms/hands and flashlight are always shown and follow the camera
  17. To buy or not to buy? I want to be able to create absolutely STUNNING landscapes, and be able to explore it in my project. The in game editor aint bad but, have you seen W.M? Is it worth it? Is it possible to export EVERYTHING youve created in W.M and then import it into Leadwerks? Trees, water and everything orrr, what? Before I purchase it I want to make a good decision. lol I dont want to spill the idea of my project but I will say this, its obviously going to be a huge open world. Hopefully the size of Chernarus in DayZ.
  18. My buddy who I am working with is making models via cinema, and he bakes the texture and all that but when we import the model its completely white and untextured and just BASIC! How do we get textures to ....export and everyithg with the texture applied to it? Any help would GREATLY be appreciated.
  19. How is everybody? Any body have a project they want to share?
  20. Hello guys! My friend and I just bought Leadwerks. I decided to stream so that you can learn with me / give me tips. And that way the staff on here can see how a total newbie to the engine feels. I hope you enjoy! Link: www.twitch.tv/papa_beans Update:: Lots of learning happening, thank you pillar!!! 10 Hours into the stream!
  21. If I buy the pre-order for 3.1 then will I get the latest version right now? There is nothing else in the store. (no other versions)
  22. Hello All, i have recently bought Leadwerks 3 and have to say that i think that Leadwerks 3 is an excellent package and i don't regret buying it. To all Leadworks developers: Great Product and keep up the great work! My professional background is 20+ years C++/VB/Java database and system programming (mostly for insurance companies). In my spare time i used Ogre 3D and Torque 3D. To the topic of the post. I have some questions regarding shader development: What are the best practices to learn/develop shaders for the engine? What tools should i use? Where can i find information about writing / using shaders specifically for the use with Leadwerks 3? Where can i get Leadwerks 3 specific information like the available uniforms etc.? Any book recommendations regarding GLSL development? For example: Where can i get information about the naming conventions of the shader files ("diffuse+glow.shader" or the dynamic/lightmapped directories). What are the requirements these different shaders have to meet? I don't need necessarily step-by-step tutorials, but some links to articles, examples or code that helped you to get into Leadwerks shader development would be really helpful. Thanks in advance!
  23. I did some searching around the forums and saw some nice shaders on display. I'm wondering, for the next 12 months, what the opengl capabilities of Leadwerks will be, and is there a resource for visually designing shaders, that works with the current version of Leadwerks? (e.g., http://www.vis.uni-stuttgart.de/glsldevil/) (http://wwwshadertoy.com) ...and is there a shader resource for copy/paste/modifing shaders? The project I'm planning for Leadwerks uses very bright, primary colors and very few game tokens. Think Bejeweled... I'm hoping I can embue the flat, rectangular surfaces of these game tokens with a gemlike sense, additionally a sense that they have gemlike interiors with faux refraction. I'd imagine multi-texturing could solve the problem. Perhaps multiple layers of textures. However I wonder if a shader is a better solution. Optimally I'd be hoping for something like a cube carved out of sample A, then colorized red, blue, green, etc. Failing that I'd go for B. Or perhaps C or D if their refraction/highlights were reactive to viewer position/angle. A http://www.shutterstock.com/pic-74820046/stock-photo-diamond-stone-on-black-space-beautiful-sparkling-diamond-on-a-light-reflective-surface-high.html?src=DhbbyzqIyRKwzlsn6tocVg-1-26 B http://www.shutterstock.com/pic-109026758/stock-photo-diamond-jewel-on-white-background.html?src=p-74820046-3 C http://www.shutterstock.com/pic-73481383/stock-vector-diamond-realistic-vector-illustration.html?src=p-74820046-4 D http://www.shutterstock.com/pic-130969427/stock-vector-vector-abstract-polygonal-background.html?src=DhbbyzqIyRKwzlsn6tocVg-1-2 Again, the game uses very few tokens, so the bang for the buck on getting these super-juicy looking would be worth it. As always, ANY ADVICE is helpful.
  24. Here are some Hybrid shaders if anyone wants to give it a spin, they support, both lightmaps and dynamic lights, they are not perfect, but feel free to experiment. (not for mobile) Material lightmode : static Material texture layout shoud be like this : you only need the ones for the shader selected, like diffuse+specular.shader only use 0 and 2.. and so on... 0=diffuse 1=normalmap 2=specular map 3=(default lightmap found in Common) 4=envmap (needs to be a cubemap created in the editor) 5=glowmap Fog They also support fog.. but.. It requires you to send color and density values (or you can hardcode it in shader). it's a vec4(float r, float g, float b, float density) So the quick way would be to set it directly in shader : fog = vec4(1.0,1.0,1.0,0.035); //somewhere in void main() But the correct way is to send it as an uniform through the application using shader:SetVec4(..) They will also work with a Gile a lightmap using the second UV channel, just assign the lightmap to texture3 in material. HybridShaders.zip
  25. I was playing Assassins Creed 3 on ps3 and noticed (amongst other things) a nice effect they did on the 'no-interior' houses windows when they were lit at nigh - where light that's coming from the house is seen on the window depending from where the player is standing .. (sorry, having a hard time finding any pics) I'm guessing instead of a classic texture with lights painted on + glow approach they used some form of cube mapping or the like, in addition to the environment map they use for reflections on the glass? At least that's the impression I've got from the quick look.. anyway, it was the first time I've seen this method. It looks nicer and adds a bit of a fake sense of depth, if you don't consciously look at it directly. It got me thinking if maybe cube maps could be used to fake an interior view on windows, because dirty, boarded up or in some other way completely covered windows just don't work everywhere. But I never took that idea any further, just a quick thought I've forgotten all about It in a flash as the game was pulling me in just too much.. until today, when searching for something unrelated I stumble upon this: demo + source + paper on a technique (appropriately) called Interior mapping.
  • Create New...