-
Posts
3,618 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Everything posted by shadmar
-
Drawing dynamic material on models and similar?
shadmar replied to Pastaspace's topic in Game Artwork
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 -
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.
-
Which door?
-
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.
-
Yey, this is cool if we can do Draw* on textures instead of just context. But we could already you say? how?
-
so now we can render text onto anything 3d?
-
Purchased through Ubuntu Software Store -- won't run, wasn't on sale
shadmar replied to blueapples's topic in Linux
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. -
who does 4:3 nowdays?
-
I wish I had something like : Probe:GetCubeMap() Which would return the cubemap of the probe.
-
Yes, and functions like GUI->DrawText() would also work on all three?
-
Camera script making the camera go down indefinitely.
shadmar replied to lxFirebal69xl's topic in Programming
What kind of resolution? Maybe round the window width and heigth. -
Are you using a material or tex as source of skybox?
-
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
-
statement goto works in windows but not linux
shadmar replied to drarem's topic in Leadwerks Engine Bug Reports
I want gosub too!! -
http://www.leadwerks.com/werkspace/page/api-reference/_/material/materialsetdepthtestmode-r253
- 1 reply
-
- 1
-
Nvidia accepts almost everything you write. Why does Intel and AMD have to be so picky?
-
These are easy to fix, anyone on AMD aswell?
-
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.
-
Looking good
-
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?
-
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())
-
Here is valve's dithering method. https://www.shadertoy.com/view/4dcSRX
-
Use the new env-probes
- 13 replies
-
- 2
-
- Level Design
- Maps
-
(and 1 more)
Tagged with: