Search the Community
Showing results for tags 'shader'.
-
Last steam beta. Lightning now is broken in my project with any values of gamma in shader or game code until they are both 1.0 Default: Camera->SetGamma(1.0f); Only in shader gamma 1.0: How should be and looks like gamma 1.0 in shader AND game code
-
After one of last updates outline shader got couple bugs: 1. Color is darker than should be 2. Outline not match model edge fully 3. Also for some reason it's looks thinner (1 pixel) than should be with same value of Thickness (3) #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(1, 0, -2); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); Vec4 color(0, 1, 0, 1); //Create a box auto box = CreateBox(world); //Render to texture box->SetRenderLayers(1 + 2); auto cam2 = CreateCamera(world); cam2->SetClearColor(0, 0, 0, 0); cam2->SetRenderLayers(2); cam2->SetFov(camera->GetFov()); cam2->SetMatrix(camera->matrix); cam2->AddPostEffect(LoadPostEffect("Shaders/Outline.fx")); auto sz = framebuffer->GetSize(); auto texbuffer = CreateTextureBuffer(sz.x, sz.y); cam2->SetRenderTarget(texbuffer); //Display overlay auto sprite = CreateSprite(world, sz.x, sz.y); sprite->SetColor(color); sprite->SetRenderLayers(4); auto mtl = CreateMaterial(); sprite->SetMaterial(mtl); mtl->SetTransparent(true); mtl->SetTexture(texbuffer->GetColorAttachment()); auto cam3 = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); cam3->SetClearMode(CLEAR_DEPTH); cam3->SetRenderLayers(4); cam3->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); auto box2 = CreateBox(world); box2->SetPosition(1, 0, 0); box2->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
-
Hi, I try to program a shader but for my use case I need a time value. For this I tried to use the extension #extension GL_EXT_shader_realtime_clock : enable // NOT ALLOWED which is not allowed in the current setup. I dont know much about Vulcan or shaders, but could this be shipped with the next update ? That would make things a lot easier as I also try to make an animated (sprite) material which is not possible without a time value. On the other hand , i tried passing it trough c++ directly using a uniform variable uniform float u_Time; which would lead to the following error. 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan Looking forward for a solution, as I said I am not experienced in shaders so maybe there already is.
-
-
-
UltraEngine Utilities
klepto2 posted a blog entry in UltraEngine - Experiences, add-ons and other Stuff
In this post, I want to introduce you to my GitHub repository: https://github.com/klepto2/UltraEngineUtilities Currently, there is not that much available, but I am working on adding more utilities and helper classes, which will help to work with UltraEngine. I had the privilege to be one of the first users of UltraEngine and was able to see the enormous amount of potential right from the beginning. So with the repo, I want to give some of the small or bigger helpers I have developed or made compatible for UltraEngine to the public. Available Features: namepace UltraEngine::Utilities::Shader ShaderCompiler A class which allows you to compile UltraEngines glsl-shaders to SPIRV format from code. ShaderWatcher This class uses the UltraEngine::FileSystemWatcher to watch changes for all available shaders used by your program It parses the ShaderFamilies Keeps track of includes Recompilation of shaders as soon as the shader file changes Automatically reloads shaders when the compilation was succesfully Sample code: How To use the Shadercompiler: #include "UltraEngine.h" #include "ComponentSystem.h" #include "include\Utilities.h" using namespace UltraEngine; using namespace UltraEngine::Utilities::Shader; int main(int argc, const char* argv[]) { auto compiler = CreateShaderCompiler(); auto result = compiler->Compile("Shaders/GUI/WidgetBlock.frag", "Shaders/GUI/WidgetBlock.frag.spv"); if (result->IsSuccesfull()) { Print("Shader compiled succesfully!"); for (auto f : result->GetIncludedFiles()) { Print("Shader includes: " + f); } } else { Print("Shader compilation failed!"); Print(result->GetError()); } ... } How to use the ShaderWatcher: #include "UltraEngine.h" #include "ComponentSystem.h" #include "include\Utilities.h" using namespace UltraEngine; using namespace UltraEngine::Utilities::Shader; int main(int argc, const char* argv[]) { auto watcher = CreateShaderWatcher(); watcher->Start(); ... } Future Features: Multiple Widgets ContainerWidgets: FlowPanel StackPanel TableLayoutPanel Scintilla Integration plain Scintilla Wrapper Advanced SyntaxEditor -widget will encapsulate some advanced features like inlining etc. Vulkan-Utilities: A port and slightly modified Version of Sascha Willems https://github.com/SaschaWillems/Vulkan/blob/master/base/VulkanTools.cpp I am as well working on some more advanced stuff, but there i have to decide how to publish them. ComputeShader-Integration Real-time PBR-Environment-Calculations Atmospheric scattering Ocean and Water rendering Here are some Screens and Animations showing some of the above Features: -
Took a break from 3d modeling work for the past few days, decided to play around with lighting and other effects in 3ds max to get a general sense of what types of environment/moods can be created. I made a material with some emissive maps and applied it to my simple cube scene, thought I would post it since it turned out pretty cool (3ds max rendering): More to come later on...
-
I'm seeking a shader tool Does anyone use ShaderTool from Steam ? link>> https://store.steampowered.com/app/314720/ShaderTool/ Does it actually work with LeadWerks ? I'm wanting to make a distortion shader since I can't find any good ones that are to my liking. Anyone know of a shader tool that works with LeadWerks ?
-
- shader
- shader tool
-
(and 2 more)
Tagged with:
-
So I've been trying to get a texture atlas to display correctly on my chunks but some of the textures are displayed sideways. I'm stumped trying to figure out how to rotate the textures. I've had some success using SetVertexNormal but I don't know how to flip them 90 degrees. Here's the shader I'm using, I converted it from this article. https://0fps.net/2013/07/09/texture-atlases-wrapping-and-mip-mapping/ //Initialize accumulators vec4 color = vec4(0.0, 0.0, 0.0, 0.0); float totalWeight = 0; vec2 tileUV = vec2(dot(ex_normal.zxy, ex_position), dot(ex_normal.yzx, ex_position)); tileOffset = vec2(0.20, 0); vec2 tileSize = vec2(0.025,0.025); for(int dx=0; dx<2; ++dx) for(int dy=0; dy<2; ++dy) { //Compute coordinate in 2x2 tile patch vec2 tileCoord = 2.0 * fract(1 * (tileUV + vec2(dx,dy))); //Weight sample based on distance to center float w = pow(1.0 - max(abs(tileCoord.x - 1.0), abs(tileCoord.y - 1.0)), 8.0); //Compute atlas coord vec2 atlasUV = tileOffset + tileSize * tileCoord; //Sample and accumulate color += w * texture(texture0, atlasUV); totalWeight += w; } //Return weighted color fragData0 = (color / totalWeight); I'm completely new to shader programming, so I'm sure there's some stupid mistake I've overlooked. Alternately I've tried using a texture array instead but have had little success. I was trying to follow this code but I couldn't get it to work. I guess texturing with algorithms is a bit more complicated than I thought it was going to be. I was planning on rendering multiple chunks and cave generation but got stuck trying to figure out how to properly texture a single chunk.
- 2 replies
-
- 1
-
- texture array
- texture atlas
-
(and 1 more)
Tagged with:
-
Hi Long time I used Leadwerks, so now I was trying to start it but went on some unexpected, when i was loading up Leadwerks this come and closed the program, I have try to remove Leadwerks folder in MyDocuments and uninstalled it from steam and reinstalled it, and used the betaversion build for last test, but it will not start, the window popups when it will load drawtext.shader thanks for help
-
when i import a new weapon and add a diffuse.shader and textures in the material editor and save this all the animations stop playing of the weapon or they play stupid in the model editor and ingame when i remove the material in model editor of my weapon and add a fake empty material the animation are playing again in the model editor and ingame and when i change rotation to of the weapon 90 degrees is ok but when i use -9.0 on the y axis the weapon disappeare but when its -8.0 first the weapon is not there ingame but when i use left mouse to fire, the weapon appeare on screen ingame, this is both on steam leadwerks 4.5 and 4.6beta standard edition
- 6 replies
-
- animations
- weapon
-
(and 2 more)
Tagged with:
-
Hi, I was thinking about a day night cycle for my next project. I found shadmars day night cycle shader, but can't find any working download link? However, even if I get my hands on his shader, I think I still need to adjust some stuff. Do you know any good tutorial/documentation, or can explain how I generally would create a day night cylce in Leadwerks? Thanks! Markus form Phodex
-
Hello Basically I want to draw have an image in the scene behind everything, but I need to have wireframe enabled. So I cant just place a face with a texture and put it behind. The skybox is also rendered in wireframe mode. So I need to have an Image Drawn before everything renders but this is impossible because I believe every pixel has a color value to it which renders over the drawn image. I also saw a thread (I think in c++) before about a similar problem from about 2014, and it said that there could be a feature for this implemented soon. So is there a feature for this ? Or a workaround ? In this photoshopped picture you can see that Leadwerks is visible but behind everything.
-
Hey, I seem to have an issue with shadows being cast/spread on my models. and I don't know what's causing it. For reference here's an image of what it looks like in Blender: Here's an overview of my material settings: The lighting settings are the standard the scene loads up with. also, there are no shaders or any sort of post processing added. Any help is very much appreciated.
-
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.
-
I'm currently writing a test using PBR shader. Right now it works, but I'm using pre-calculated environment (irradiance) map. I know that an environment is provided with the deferred rendering, but I want to use the texture sampler in the main shader because the calculation for the sampling (importance) is different. I would like to know if it is possible to access the sampler (to be bound) when during the 1st pass of the deferred. (for example texture15). Thanks;
-
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
-
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.
-
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.
-
I create material from water1_0.tex, i material editor i pick the water shader. After creation material, i create brush with material. i see artefact's on brush. Help!
-
Hi, I recently bought a new Windows 10 laptop with an Intel HD Graphics 520 chipset. I installed Leadwerks, and everything ran fine until I loaded up one of my projects. When I tried to switch the viewport to "Textured + Lighting" I got an "Error: failed to compile fragment shader". If I switch to any other view mode, it renders everything fine. It also will not properly render the game when I click run. I consider myself much more of an artist than a programmer, so I'm at a loss as to what that error could possibly mean. Any help would be appreciated.
-
Hello, Today I find out something weird about leaves shader. the bush material which was applied this shader only receives light on one side
-
Hey guys, Yet another issue I'm faced with, and is probably real simple to accomplish but I can't seem to understand how to do it. How do I add a Post-Processing shader to my work? Not a single model, but to the entire level? Thanks in advance!
- 5 replies
-
- Shader
- Post Processing
- (and 4 more)
-
I've lost the ability to change the Shader associated with a material. I've moved the size and side sliders with no luck. I have tried looking in the properties and options menu but can not find anything there to help. Any ideas?