-
Posts
465 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Aily
-
-
TextureFilter(tex,TEXFILTER_SMOOTH) ?
-
Aily... i believe klepto did it and posted it in his blog... but he did it without using the LE inherent commands but rather raw opengl...
http://www.leadwerks.com/werkspace/blog/16/entry-654-cubemaps-realtime-here-we-go/
which to me indicates there is something wrong with LE's implementation...
Yeah, i saw thais, but im making this by LUA, and such method is impossible there, you know it yourself That's why ask Josh to fix this.
-
I'm on my Mac right now and don't have an easy way of checking your texture, but if it doesn't have mipmaps, NVidia cards will render it pure black.
Thanks for turbo reply
Even if i use?
textureCubeLod(LW_CUBEMAP,cubecoord,0)
So then any way to build mipmaps after buffer render? (let it be so, let it be so....... )
-
Hi Josh.
Here have strange things. That's code to render to simple 2D texture, it works great
Framework leadwerks.engine registerabstractpath AppDir Graphics 800,600 createworld cp=createpivot() cam=createcamera() cameraclearcolor cam,vec4(.5,.5,.5,1) entityparent cam,cp moveentity cam,vec3(0,1,-1) pointentity cam,cp c=createsphere() mat=creatematerial() setmaterialshader mat,loadshader("abstract::mesh.vert","abstract::mesh_diffuse.frag") tex=createtexture(256,256) setmaterialtexture mat,tex,0 paintentity c,mat tex_buffer=createbuffer(256,256,BUFFER_COLOR) setcolorbuffer tex_buffer,tex,0 setbuffer tex_buffer SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 Repeat If KeyHit(key_escape) Or AppTerminate() End turnentity cp,vec3(0,.2,0) setbuffer backbuffer() renderworld Flip 1 Forever
Here's the code to load cubemap from file, and just to check that mesh_cubemap.frag works:
Framework leadwerks.engine registerabstractpath AppDir Graphics 800,600 createworld cp=createpivot() cam=createcamera() cameraclearcolor cam,vec4(.5,.5,.5,1) entityparent cam,cp moveentity cam,vec3(0,1,-1) pointentity cam,cp c=createsphere() mat=creatematerial() setmaterialshader mat,loadshader("abstract::mesh_cubemap.vert","abstract::mesh_cubemap.frag") tex=loadtexture("abstract::sunol_cubemap.dds") setmaterialtexture mat,tex,0 paintentity c,mat Repeat If KeyHit(key_escape) Or AppTerminate() End turnentity cp,vec3(0,.2,0) setbuffer backbuffer() renderworld Flip 1 Forever
And this is code like above, but drawing to cubemap:
Framework leadwerks.engine registerabstractpath AppDir Graphics 800,600 createworld cp=createpivot() cam=createcamera() cameraclearcolor cam,vec4(.5,.5,.5,1) entityparent cam,cp moveentity cam,vec3(0,1,-1) pointentity cam,cp c=createsphere() mat=creatematerial() setmaterialshader mat,loadshader("abstract::mesh_cubemap.vert","abstract::mesh_cubemap.frag") tex=createcubemap(256,256) setmaterialtexture mat,tex,0 paintentity c,mat tex_buffer_0=createbuffer(256,256,BUFFER_COLOR) tex_buffer_1=createbuffer(256,256,BUFFER_COLOR) tex_buffer_2=createbuffer(256,256,BUFFER_COLOR) tex_buffer_3=createbuffer(256,256,BUFFER_COLOR) tex_buffer_4=createbuffer(256,256,BUFFER_COLOR) tex_buffer_5=createbuffer(256,256,BUFFER_COLOR) setcolorbuffer tex_buffer_0,tex,0,0 setcolorbuffer tex_buffer_1,tex,0,1 setcolorbuffer tex_buffer_2,tex,0,2 setcolorbuffer tex_buffer_3,tex,0,3 setcolorbuffer tex_buffer_4,tex,0,4 setcolorbuffer tex_buffer_5,tex,0,5 setbuffer tex_buffer_0 SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 setbuffer tex_buffer_1 SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 setbuffer tex_buffer_2 SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 setbuffer tex_buffer_3 SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 setbuffer tex_buffer_4 SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 setbuffer tex_buffer_5 SetColor vec3(0) DrawRect 0,0,256,256 SetColor vec3(1) DrawRect 50,50,100,100 Repeat If KeyHit(key_escape) Or AppTerminate() End turnentity cp,vec3(0,.2,0) setbuffer backbuffer() renderworld Flip 1 Forever
As you can see - i'm using same technique as draw to 2D texture - assign it to buffer,
But with cubemaps im assigning cubefaces to 6 buffers.
Think this code must be work, but it didnt Maybe you can show the correct way to use render to cubemaps?
Thanks.
-
This is the result, wip.
But have another problem with the text when i draw it to a texture.
You need to flip by Y
DrawImage(texture, 0 , Y , X , -Y )
-
Long time fighting fith charachter controller don't give good result for my Last Chapter platformer.
So Arbuz give me a good idea - make my own AABB collisions engine, because Last Chapter in fact have only box bodies.
Hahaha!!!! Now with this i can make movable platforms, accurate to metall attachement player and much more!
This is AABB collisions base, maybe someone will be make such platformer
Global bodies:TList=CreateList() Type body Field x#,y# ' aa Field w#,h# ' bb Field width# Field height# End Type Function add_body:body(x#,y#,width#,height#) Local b:body=New body b.x=x-width/2 b.y=y-height/2 b.width=width b.height=height b.w=b.x+width b.h=b.y+height ListAddLast bodies,b Return b End Function Function render_bodies() For b:body=EachIn bodies SetColor 255,255,255 DrawRect b.x,b.y,b.width,b.height SetColor 50,50,50 DrawRect b.x+1,b.y+1,b.width-2,b.height-2 Next End Function Function ol(pv#,cv#,nv#) Return cv>pv And cv<nv End Function Function move_body(b:body,x#,y#) nx#=b.x+x ny#=b.y+y nw#=b.w+x nh#=b.h+y fx#=x fy#=y For bb:body=EachIn bodies If bb=b Continue If fx>0 If ol(bb.x,nw,bb.w) Or ol(b.x,bb.x,nw) If ol(bb.y,ny,bb.h) fx=bb.x-b.w If ol(bb.y,nh,bb.h) fx=bb.x-b.w If ol(ny,bb.y,nh) fx=bb.x-b.w If ol(ny,bb.h,nh) fx=bb.x-b.w If bb.y=b.y And b.h=bb.h fx=bb.x-b.w End If End If If fx<0 If ol(bb.x,nx,bb.w) Or ol(nx,bb.w,b.w) If ol(bb.y,ny,bb.h) fx=bb.w-b.x If ol(bb.y,nh,bb.h) fx=bb.w-b.x If ol(ny,bb.y,nh) fx=bb.w-b.x If ol(ny,bb.h,nh) fx=bb.w-b.x If bb.y=b.y And b.h=bb.h fx=bb.w-b.x End If End If If fy>0 If ol(bb.y,nh,bb.h) Or ol(b.y,bb.y,nh) If ol(bb.x,nx,bb.w) fy=bb.y-b.h If ol(bb.x,nw,bb.w) fy=bb.y-b.h If ol(nx,bb.x,nw) fy=bb.y-b.h If ol(nx,bb.w,nw) fy=bb.y-b.h If bb.x=b.x And b.w=bb.w fy=bb.y-b.h End If End If If fy<0 If ol(bb.y,ny,bb.h) Or ol(ny,bb.h,b.h) If ol(bb.x,nx,bb.w) fy=bb.h-b.y If ol(bb.x,nw,bb.w) fy=bb.h-b.y If ol(nx,bb.x,nw) fy=bb.h-b.y If ol(nx,bb.w,nw) fy=bb.h-b.y If bb.x=b.x And b.w=bb.w fy=bb.h-b.y End If End If Next b.x=b.x+fx b.y=b.y+fy b.w=b.w+fx b.h=b.h+fy End Function Graphics 800,600 add_body(410,160,20,240) add_body(50,70,20,140) add_body(50,210,20,140) add_body(230,290,340,20) add_body(130,150,20,100) add_body(280,170,120,20) player=add_body(310,260,20,40) Repeat If KeyHit(KEY_escape) Or AppTerminate() End shift=KeyDown(key_lshift)*200 If KeyDown(key_left) move_body player,-2-shift,0 If KeyDown(key_right) move_body player,2+shift,0 If KeyDown(key_up) move_body player,0,-2-shift If KeyDown(key_down) move_body player,0,2+shift Cls render_bodies Flip 1 Forever
Here's compiled EXE, arrows-for move, shift - some speedup movable body (check swept collisions)
-
Hi to all
I'm store 6 textures in one big texture, now it's like on image "rect.jpg", i.e. my texture is rectangle.
Long time ago, when i started to learn OpenGL i was read that is need to store textures as rectangles
32x32, 64x64.....2048x2048... because some of video hardware working with square textures only.
But more handy and simple to store texture in one strip-line, as on "strip.jpg".
Anybody know, how is better to store textures? Rectangles, or doesn't matter - textures can be any proportions?
-
Cool! Thanks klepto2
-
HAHAHA post title is cool!
HAHAHAHAHA :D :D
-
Looking forward to seeing where you go with this Aily, nice work!
Thank Pixel, now porting it to LUA. It will be very funny!
-
That's pretty amazing.
Your pathfinding looking better But mine - for 2.41 :D
-
I don't know how your NPCs are walking.
My first idea was a waypoints - and i maked it for LUA, my NPC can walk in Editor, but as like on rails.
So i spended some time to write this simple mesh pathfinding.
Now it on b3d, i'm planing to some update it and port in Leadwerks Editor.
To set start-finish nodes use mouse right\left buttons.
To see debug lines hold space button.
-
Almost all in BMax is *
C++
TPickInfo * p=new TPickInfo;
p->a=1;
BMax
local p:Tpickinfo=new Tpickinfo
p.a=1
-
Try to send 2 messages
SendEntityMessage(src , "Jump")
SendEntityMessage(src , "die")
Are they hapenning each other, or last only?
-
Disable debug mode, and antivirus - compile will be fast, and font will be loads fast.
-
The idea is simple:
I want to make one lua class to control NPC for example.
Now i have one NPC, lets call it JOE.gmf
JOE have script JOE.lua, with architecture as all other LUA scripts in Leadwerks.
JOE.lua have many lines of code, and many parameters.
Now i add new NPC, let's call it MAX.gmf
MAX have same code, but another parameters. May be MAX can shot.
I copy now JOE.lua to MAX.lua, and ajust parameters.
All cool, JOE and MAX walking in world.
BUT!!!
I see that them stacking in each other then close to each other.
I need to fix both lua files in same time?
I try to do:
copy JOE.lua to "scripts\npc.lua" file
clear JOE.lua code
And put there only require("scripts/npc")
And i have error, that classtable is nil. It is normal? Anyone knows how to correct include files?
-
well you could just post your game sdk so we can play it!
I think after selling it i will post here full source code and media
-
is it available to play?
No, it's in my game SDK only. Don't want to make pack for one level.
Just write here about some progress.
He-he, five more to go!
-
It could become some official new Game Framework for LE2.
Josh maked same in LUA scripts. So better was to do all game in LUA. But now - is not possible to move back, and i will finish it in Bmax. My next game will be in LUA.
-
-
If you add your game here, it will get a ton more downloads over time. Furious Frank has been downloaded more than 4000 times:
http://www.leadwerks.com/werkspace/files/file/278-the-last-chapter/
-
Cool models! I want to play with it
-
if entitydistance(mesh,player)<10 pointentity mesh,player
-
Ha! Funny minigame Need to play it before any FPS shooter, to up skill to strafe.
I have feeling, that oildrums is strafe a little with me left-right.
Menu fire realy cool
Moving along the path
in Programming
Posted
My NPC have controller,head pivot and mesh
Each UpdatePhysics i have one current NPC target, and i do this:
1. set head pivot to controller position
2. point head smooth to current target waypoint
3. move controller forward using head.Y as controller turn
Something like that. Movement is smooth enough.
On NPC creation
and on PhysicsUpdate