Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. Quick updated code: --Initialize Steamworks (optional) Steamworks:Initialize() --Set the application title title="test" --Create a window local windowstyle = window.Titlebar if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+window.FullScreen end window=Window:Create(title,0,0,System:GetProperty("screenwidth","1024"),System:GetProperty("screenheight","768"),windowstyle) window:HideMouse() --Create the graphics context context=Context:Create(window,0) if context==nil then return end --Create a world world=World:Create() world:SetLightQuality((System:GetProperty("lightquality","1"))) --create buffer, acamera and material buffer = Buffer:GetCurrent() camera = Camera:Create() light = DirectionalLight:Create() light:SetRotation(45,45,45) box1 = Model:Box() mat1 = Material:Create() shader = Shader:Load("Shaders/model/diffuse.shader") mat1:SetShader(shader) shader:Release() box1:SetPosition(0,0,3) box1:SetMaterial(mat1) mybuffer = Buffer:Create(100,100,1,1) while window:KeyDown(Key.Escape)==false do box1:Turn(1,1,1) --If window has been closed, end the program if window:Closed() then break end --Update the app timing Time:Update() --Update the world world:Update() --Render the world world:Render() --draw context to buffer Buffer:SetCurrent(mybuffer) context:SetBlendMode(Blend.Alpha) context:SetColor(.1,.1,.1,1) context:DrawRect(0,0,100,100) context:SetColor(1,.5,0,1) context:DrawText(string.format("FPS: %.2f",Time:UPS()),15,40) tex = mybuffer:GetColorTexture(0) mat1:SetTexture(tex,0) Buffer:SetCurrent(context) --Refresh the screen context:Sync(true) end Pic
  2. Sorry I missed : Buffer:SetCurrent(self.mybuffer) before doing context, I see what you did here. Thanks for the example. I didn't know you could do this.. awesome. Edit: had a chance to run it, works great and I updated your example script slightly.
  3. Mack, I think you misunderstand, I want to draw text to a texture. DrawText() is context command which is not a part of Render(), I think? Show me how to draw text onto a texture using DrawText(), decals are not text.
  4. Yey, this is cool if we can do Draw* on textures instead of just context. But we could already you say? how?
  5. so now we can render text onto anything 3d?
  6. That is an outdated version 3.1, I'm surprised it's still in there since Leadwerks went 100% steam a while back. Anyway you need an OpenGL4 card equivalent to DirectX 11 to run it with updated propritary drivers to run it.
  7. shadmar

    GUI Design

    who does 4:3 nowdays?
  8. I wish I had something like : Probe:GetCubeMap() Which would return the cubemap of the probe.
  9. shadmar

    More GUI Design

    Yes, and functions like GUI->DrawText() would also work on all three?
  10. What kind of resolution? Maybe round the window width and heigth.
  11. Are you using a material or tex as source of skybox?
  12. Ok I added this function which I know nvidia accepts and intel does not: float testfunc(float x, float y=1.0) { return x*y; } it compiles ok using F6, but using F5 it now shows an error in line 28 Validating vertex shader... Validating pixel shader... Error validating pixel shader. Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. ERROR: 0:28: '' : syntax error ERROR: 1 compilation errors. No code generated. 0 errors, 0 warnings
  13. http://www.leadwerks.com/werkspace/page/api-reference/_/material/materialsetdepthtestmode-r253
  14. Nvidia accepts almost everything you write. Why does Intel and AMD have to be so picky?
  15. These are easy to fix, anyone on AMD aswell?
  16. Try git locally, it wil track all changes to all files and show you the diff even, and you can just revert the LE update if not happy.
  17. Also isris only work if it's the first pp-shader, ex. having ssao.shader before seems to break it, maybe alpha is more than 1 when starting iris adjustments writing to alpha channel?
  18. This works fairly well, your average lum detector is better than mine, but I had adjust the alpha adjustment down to avoid flickering scene. I think this is perfect: context:SetColor(1,1,1,0.02 / Time:GetSpeed()) to context:SetColor(1,1,1,0.005 / Time:GetSpeed())
  19. Here is valve's dithering method. https://www.shadertoy.com/view/4dcSRX
×
×
  • Create New...