Jump to content

flachdrache

Members
  • Posts

    397
  • Joined

  • Last visited

Everything posted by flachdrache

  1. However, if you use indeed cubes i might would try to have pre defined sets of textured cubes and use a position(s) texture to arange the already textured cubes properly.
  2. You could write an "alphaRamp" shader which blends the textures based on the vertexcolor alpha value, which means 25% rockTexture, 50% sandTexture, 75% grass1Texture, 100% grass2Texture - while blending happens in between. You could do that based on terrain height too, by setting its vertex color in the range of Y using rgb - as above. Here is how i have done that in the pixelshader of my "ScarletFever" engine ... float4 pixel = tex2D(IN.mask, IN.baseCoord); float4 color0 = float4(0, 0, 0, 0); if(pixel.r) { float4 skinRock = tex2D(IN.texRock, IN.tCoord) * pixel.r; color0 += skinRock; } if(pixel.g) { float4 skinGrass = tex2D(IN.texGrass, IN.tCoord) * pixel.g; color0 += skinGrass; } if(pixel. { float4 skinSnow = tex2D(IN.texSnow, IN.tCoord) * pixel.b; color0 += skinSnow; } if(pixel.a) { float4 skinDirty = tex2D(IN.texDirty, IN.tCoord) * pixel.a; color0 += skinDirty; } OUT.col = color0; ... i have never done that but messing up the inRGB sampler with a perlin noise filter could add some additional variation. PS: the early version, in my XNA engine, was heavily based on these tutorials. hth
  3. You most likely dont need to calculate that since Le is all "entity-based" ... you simply want to set the position / rotation of your bolt / bullet to the position / rotation of the body or set its complete EntityMatrix. I took "all" the commands i would need to build game-subsystems from the command list and wrote samples for it. It doesnt help much with integration the game-engine itself but game-mechanics can be extracted from it. here is some, slightly changed, script metraton posted (dont know how to write that name though) --stuff which should be part of LE --the best working round function, works also for negative idp (written by Robert Jay Gould) function round(num, idp) return tonumber(string.format("%." .. (idp or 0) .. "f", num)) end BLEND_NONE=0 BLEND_ALPHA=1 --end of stuff which should be part of LE local width=1920 local height=1080 require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") require("scripts/classes/bullet") if fw==nil then --we are not in Editor RegisterAbstractPath("") Graphics(800,600) fw=CreateFramework() scene=LoadScene("abstract::Actors_obstacleDM1.sbx") scene:SetCollisionType(COLLISION_SCENE) TFilter() AFilter() SetHDR(true) SetSSAO(true) SetBloom(true) standalone=1 end --Variables dx=0.0 dy=0.0 camerapitch=0.0 camerayaw=0.0 move=0.0 strafe=0.0 cameraheight=1.9 --ScrennshotBuffers local buffer=CreateBuffer(width,height,BUFFER_COLOR) if buffer==nil then Notify("Failed to create buffer!",1) return end local buffer2=CreateBuffer(width,height,BUFFER_COLOR) if buffer2==nil then Notify("Failed to create buffer!",1) buffer=nil return end --array of "info_playerstart" ... classname --lobby might use different spots. local playerstart = nil playerstart = scene:FindChild("playerstart") --Create a player controller controller=CreateController(1.8, 0.46, 0.25, 45) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetMass(10) SweptCollision(controller, 1) if standalone==1 then if playerstart ~= nil then controller:SetPosition( playerstart:GetPosition() ) else controller:SetPosition(Vec3(0,20,0)) end else controller:SetPosition(fw.main.camera.position) end camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y+180 controller:Move(Vec3(0,-0.9,0)) local gunscale=0.6 local vwep = LoadMesh("abstract::vwep_hands.gmf") LoadMesh("abstract::vwep_gun.gmf",vwep) vwep:SetParent(fw.main.camera,0) vwep:SetPosition(Vec3(-0.18*gunscale,-0.03*gunscale,0.37*gunscale),0) vwep:SetScale(Vec3(0.04*gunscale,0.04*gunscale,0.04*gunscale)) local gundisplayposition = vwep:GetPosition() sound_gunshot = LoadSound("abstract::gunshot.ogg") source_gunshot = CreateSource(sound_gunshot) source_gunshot:SetVolume(0.5) vwep :SetShadowMode(0,1) local displayposition=Vec3(-0.26/2.0,-0.03,0.19) local muzzleflash = CreatePointLight(3) muzzleflash:SetParent( vwep ) muzzleflash:SetColor(Vec4(1,0.6,0.0,1.0)) muzzleflash:SetPosition( displayposition ) muzzleflash:SetShadowMode(0) HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) FlushKeys() FlushMouse() local pick local camera = fw.main.camera local remainingtime local starttime=AppTime() local gameduration=2--length of game in minutes local gamemode=0 gunpos = vwep.position:Copy() local smoothedgunswayamplitude= 0.0 local smoothedgunswayspeed = 0.0 local guntime = 0.0 local recoil = 0.0 local lastfiretime=0.0 local smoothrecoil=0.0 local swaydamping=0.0 local smoothswaydamping=0.0 local lightsmoothing =0.0 local gunlight = 0.0 --Flashlight flashlight = {} flashlight.light = CreateSpotLight(8) flashlight.light:Hide() flashlight.sound_switch = LoadSound("abstract::switch.wav") flashlight.state=0 flashlight.light:SetConeAngles(30,35) flashlight.light:SetRotation(Vec3(5,0,0)) flashlight.light:SetShadowmapSize(512) flashlight.light:Paint(LoadMaterial("abstract::flashlight.mat")) function flashlight:SetState( state ) if state~=self.state then self.state=state if state==0 then self.light:Hide() else self.light:Show() end if self.sound_switch~=nil then self.sound_switch:Play() end end end function ShootBullet( position, direction ) -- local speed=100.0 -- local pick = LinePick( position, Vec3(position.x+direction.x * speed) ) end function DrawHUD(contr) SetBlend(BLEND_ALPHA) DrawText("pos: "..round(contr.position.x,3)..","..round(contr.position.y,3)..","..round(contr.position.z,3),1,FontHeight()*5) DrawText("rot: "..round(contr.rotation.x,3)..","..round(contr.rotation.y,3)..","..round(contr.rotation.z,3),1,FontHeight()*6) SetBlend(BLEND_NONE) end --main function while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end local time = AppTime()/3200.0 local frame = time*(179.0-96.0)+96.0 frame=Clamp( frame, 96, 179 ) vwep:Animate(96,1,0,1) --Camera look gx=Round(GraphicsWidth()/2) gy=Round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,89) camerapitch=math.max(camerapitch,-89) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=6 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end --Player movement move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) --Use objects if KeyHit(KEY_E)==1 then pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then repeat if pick.entity:GetClass()==ENTITY_MODEL then break end pick.entity=pick.entity.parent until pick.entity==nil if pick.entity~=nil then pick.entity:SendMessage("use",controller,0) end end end --crouching if KeyHit(KEY_C)==1 then if controller:IsCrouched()==1 then crouch=0 cameraheight=1.7 else crouch=1 cameraheight=0.85 end end --Update controller --controller:Update(camerayaw,move,strafe,jump,40,10) controller:Update(camerayaw,move,strafe,jump,40,10,crouch) fw:Update() if KeyHit(8)==1 then dofile("GUIindex.lua") end if KeyHit(KEY_F)==1 then flashlight:SetState(1-flashlight.state) end --Position camera camera:SetPositionf(controller.position.x,controller.position.y+cameraheight,controller.position.z,1) time=AppTime() gunfirefrequency=80 gunswayspeed=0.001*20.0 gunoffset = gunpos:Copy() gunswayamplitude = 0.02 if KeyDown(KEY_W)==1 or KeyDown(KEY_D)==1 or KeyDown(KEY_A)==1 or KeyDown(KEY_S)==1 then gunswayamplitude = 0.03 gunswayspeed=0.005*20.0 end smoothedgunswayamplitude = Curve( gunswayamplitude, smoothedgunswayamplitude, 8.0 ) smoothedgunswayspeed = Curve( gunswayspeed, smoothedgunswayspeed,8.0 ) if smoothrecoil<0.001 then guntime = guntime + AppSpeed() * smoothedgunswayspeed * math.max(0.0,1.0 - smoothswaydamping) end gunoffset.z = gunoffset.z - smoothrecoil * 0.05 smoothedgunswayamplitude = smoothedgunswayamplitude * (1.0 - smoothswaydamping) gunoffset.x = gunoffset.x + math.sin( guntime ) * smoothedgunswayamplitude * gunscale gunoffset.y = gunoffset.y + (1.0-math.cos( guntime*2.0 )) * 0.005 * gunscale * math.min(1.0,1.0 - smoothswaydamping) vwep:SetPosition( gunoffset ) recoil = recoil-0.1 swaydamping = math.max( swaydamping - 0.05, 0.0 ) recoil = math.max(recoil,0.0) smoothrecoil=Curve(recoil,smoothrecoil,3.0) smoothswaydamping = Inc( swaydamping ,smoothswaydamping,0.01 ) gunlight = math.max( gunlight- 0.2, 0.0 ) lightsmoothing =gunlight-- Curve(gunlight,lightsmoothing,8.0) muzzleflash:SetColor(Vec4(1.0*lightsmoothing,0.6*lightsmoothing,0.0,1.0)) if lightsmoothing <0.01 then muzzleflash:Hide() end if MouseDown(1)==1 then if AppTime()-lastfiretime>gunfirefrequency then recoil = 1.0 lastfiretime=AppTime()+math.random(0,20) gunswayspeed=0.0 gunlight = 1.0 source_gunshot:Play() source_gunshot:SetPitch(1.0 + (math.random()-0.5)*0.05 ) swaydamping = 1.0 muzzleflash:Show() CreateBullet(vwep:GetPosition(1) , fw.main.camera.mat:K():Scale(300)) end end if MouseHit(2)==1 then phyproj = CreateBodyBox(1,1,1) projectile = CreateCube(phyproj) projectile:SetColor(Vec4(math.random(0,255)/255,math.random(0,255)/255,math.random(0,255)/255,1)) phyproj:SetMass( 1 ) phyproj:SetCollisionType(1,0) local V = TFormVector(Vec3(0, 0, 2), fw.main.camera, nil) V = Vec3(fw.main.camera.position.x + V.x, fw.main.camera.position.y + V.y, fw.main.camera.position.z + V.z) PositionEntity(phyproj, V, 0) RotateEntity(phyproj, EntityRotation(fw.main.camera, 0), 0) phyproj:AddForcef(0, 100, 1500, 0) end UpdateBullets() flashlight.light:SetPosition(fw.main.camera:GetPosition(1)) flashlight.light:SetRotationf( CurveAngle( fw.main.camera.rotation.x, flashlight.light.rotation.x, 3.0/AppSpeed() ), CurveAngle( fw.main.camera.rotation.y, flashlight.light.rotation.y, 3.0/AppSpeed() ) ) flashlight.light:Movef(-0.07,-0.04,0.02) fw:Render() -- screenshot : note the second fw:Render() if KeyDown(KEY_F12)==1 then SetBuffer(buffer) fw:Render() SetBuffer(buffer2) DrawImage(GetColorBuffer(buffer),0,0,buffer:Width(),buffer:Height()) SetBuffer(BackBuffer()) SaveBuffer(buffer2,"screenshot.png") end DrawHUD(controller) Flip(0) end buffer=nil buffer2=nil controller:Free() vwep:Free() ShowMouse() hth
  4. File Name: devmex_Le231_ShaderSet01_detail File Submitter: flachdrache File Submitted: 26 Aug 2011 File Category: Shaders devmex_Le231_ShaderSet01_detail ---------------------------------------------------- Supportive shader/material for my upcoming downloads. "Additional", detail shaders and normalmaps ... mostly just defining preprocessor switches really. Click here to download this file
  5. I somewhat missed the post from the "27 July 2011" - since my legal stuff should be sorted i might join too. I got many low price assets with in good shape / quality but some are not complete yet.
  6. Hmmm, i played Doom3 with all shadows even the own, player shadow, enabled and it somewhat got boring having to switch the flashlight because my own shadow made me not see things. On the other hand deadSpace "doesnt" use shadows and many others aint too. I would be more in need of "volume" fog and a good bunch of particle emitters + the knowledge if/how to get a steady framerate. Besides most released le2 games could be ported to lua as much as my little mini-game could be ported from lua to c, imho. Let me think about the possibilities but basically i would.
  7. File Name: DirtyRottenSet_u3dSource.zip File Submitter: flachdrache File Submitted: 25 Jul 2011 File Category: Models Triangles: some LOD Versions: No The source files of my "Garbage - DirtyRottenSet" in u3d format for Ultimate Unwrap 3DPro. Click here to download this file
  8. imho the style would be quit nice for a HUD too and i might snatch the idea. Number 47 uses such hud which makes it look just funktional inGame - these kinds do suffer quit easy from over doing things however.
  9. I know "random individual opinions" as much as i know "random individual ideas". I dont mind at all if its straight and solid - i just think that too many options are kind of "bewildering".
  10. Now that i actually dealing with "constructing" a menu i realised that all kinds of glsl shaders are "not" reachable with in 3rd party solutions ... if you just use leadwerks build in commands it would be xtreemly nice to share your work here. anyways, keep it up.
  11. I voted for "Space Invaders 3D" - just because this post is by far your most strangest offer to date. Your For-Tran note was still funny but more community "spreadsheets". I consider myself a dll developer and not a lab worker here.
  12. As of actual using .Net derivations, in a no "one hit wonder" environment - there where several issues i had in the past with it. Namely it was always a constant w.i.p. - especially with the XNA framework including abandoned support for so called "project updaters". Within leadwerks it had been the license question issue which made me not using it - if its provided "As-Is" its more close to "public-domain" but non the less these restrictions made it somewhat float in mid air, beside (in the mean time) its about two years ago i wrote something good with it. If its included in the sdk, within the same eula - i might rather use the provided engine commands in a .Net, for extended game-tools-pipeline programing than a strange 3rd party openGL solution.
  13. Since the 2.43 "bugs" seam to only appear for few of us -- i highly suggest to get some option for evaluation users to report bugs and issues ... would help us greatly to react and handle such issues for with our upcoming releases ! PS: could you make such community things sticky in the forum ... i might miss half of it.
  14. Exactly - the pipeline worked out just like it should be. I wouldn't say programmer friendly but doable with little experience in blender. The mode itself has some issues which i need to fix still but the pos and orientation is finally there. The script is just like the monsterTruck but with 4x steering wheels. I already had imaginations of all kinds of horror scenarios for work arounds really ... good that no 6k model programm is needed too. I think grouping isnt needed at all just the models relation to each-other need to be obtained.
  15. Well, i dont consider advertising being a wish list either but since there is no real sample for it i guess the script just breaks at one point. I was just too tired to go on / clean up. Edit: solved ... one actually just need to update all tires in the array. Clean and tweak vehicle model in uu3d to obj to blender-2.56, for positioning tires etc. relative to vehicle body (group origin to geometry).
  16. OK - somewhat solved ... no 8 wheels though - i only get 4 visible wheels to spin atm.
  17. ? Thats the first time i read about a position of a subMesh could get lost - i wouldnt mind to set up a pivot rig ... if it works. So, there are still 6 to 9 other ways to do it differently ... good. PS: here is the 8 wheeler - just for reference. Jeep and Truck Models where found on the interweb w/o attached license e.g. for private use only. If you are a fancy 3dStudioMax owner - i wouldnt mind to get a working stryker_truck 8 wheeler. Edit : I looked in my database and the stryker vehicle was downloaded from "gfx-3d-model.blogspot.com" but is no longer featured there. Models w/o license end up in my "non-commercial" folder but this particular model was offered as no-strings-attached download.
  18. Well, i try to get a 8 wheeler vehicle lua script to work and keep failing with the given .gmf pipeline. Currently i want to verify the memory leak the default monster_truck.lua produces but le2.43 keeps overwriting the .phy collider mesh in its own, given, folder ... and it seams the garbage collector of le2.43 just does a better job. The bad thing is, i need to fully understand leadwerks implementation within its newton boundaries - since i need the 8 wheeler, a jeep and a motorcycle for the player to drive. Please understand my issue here ... its by design. Well, here`s the deal ... UU3D cant export multi-group .gmf models (to my knowledge) - only fbx2gmf.exe does keep its childs to be found. The models structure looks like : scene-root (mesh:Static_Mesh) - Mesh:body - Mesh:Tire_L1 etc. etc - Mesh:TirePivot_L1 etc. etc Yes, i added tires and tire pivots ... just to have them available. These are scene root childs which can be found to hide/replace the visual models - which does happen. Here is the block of script : pivot=object.model:FindChild("PL1") -- PL1 is a Mesh:TirePivot if pivot~=nil then Print("found PL1") tireradius=pivot.aabb.h*2.0 object.vehicle:AddTire(TFormPoint(pivot.position, pivot.parent, model),tireradius,suspensionlength,springconstant,springdamper) object.tire[0]=LoadMesh("abstract::vehicle_truck_stryker_Wheel.gmf", object.model) pivot:Hide() end The "pivot" gets found and hidden, no matter if its my "Mesh:TirePivot" or my "Mesh:Tire". The instance of "TFormPoint(pivot.position, pivot.parent, model)" is what bugs me the most - the "model" in the line does have no reference but the very "class:CreateObject(model)" - which looks like a hack non the less. Even if the pivots got found and replaced by its visual, non physic, vehicle tires - the actual "AddTire" fails on me ... please take a look into the provided model source and help me understand this newton thing here ... a dummy vehicle SDK setup would be nice too and highly needed because of the model pipeline. thx.
  19. ... nah dann schreib halt "Lehnsherr" ... done pretty much everything in gamedesign, i dislike weightpainting and my timing is too bad for hand made character animations + i dont draw but rather construct ... which is as slow as it sounds.
  20. Nice to see someone with a identical history. As far as i can tell is torque3D a little more basic but already got some more advanced addons (extra cost though) which youll have to code yourself (or team up with someone which aint easy neither). Sind ein paar mehr deutsche hier - also würde ich mir einen anderen Namen zulegen. Mein politisches Interesse reicht nur für den Gedanke das weniger Mist in die Welt getragen werden sollte, aber du möchtest keine "Diktatur der Gutmenschen" heraufbeschwören. ... just a headsUp for us germans. You might like to find "Thinking in C++", which is free to read online iirc. hth PS: here is mine ... well you know, one day i had to post a link.
  21. Which would be great for the ipad ... 200 sidescroller a la "manhattanProject" in the first year - i wonder which gametypes we might develop on the iThing next xear. Anyways - dont want to rain on your parade but there is an still an issue, in the tracker, i need to know more about ...
  22. The "Terrain shadowing bug" appears on middle and large terrain maps in the demo version but was fixed soon after its release. PS : i was referencing to a bug which was marked as solved, in the bugtracker around the 2.31 version, - great that this turned out to be a non issue.
  23. Seamless does sound nice but, - the lack of vertexPainting keeps be from exporting models right away. Hopefully josh can find the time to consider adding Vpaint to Le3.
  24. Looks like one phy object ( the car ) tries to penetrate the other ( fence ) and that the tires are too small. For the first issue i would oversize and simplify the fence phy ( put it in a box if its just used as fence ) and might even send a message to the car that a. the car breaks the fence or b. the car has to reset all its forces with the "object:Collision" function. The second one i would say one can easily hang in mid air ( gameplay wise ) and that the tires from the monster truck do seam to help giving enough air between chassi and street so the car does not get stuck between two rocks - at least i would say remodel the tires with a higher polycount ... but josh might know better if higher polycount on the phy model is any good. Dont know if this can help but here are my defaut values local suspensionlength =0.30 local springconstant =70.0 local springdamper =150.0 --- object.model.buoyant = 0 object.model:SetKey("collisiontype",COLLISION_CHARACTER) object.model:SetKey("mass",2.5) object.model:SetMassCenter( Vec3(0, -0.5, 0) ) PS: If one drives over an allready broken-down fence the fence should be of no collision type. hth
  25. Hey Tyler - in fact my assumptions are partially based on some of the lua classes you posted. This event message dispatcher might work in the lua world alone, setting postprocessing fx and other client behavior might be controlled in source code. However, if the player steps on the firepit i dont see a reason why it shouldnt controll timing a fire emitter and such. I basicall want to put a timer entity in the scene which counts the seconds the game is running and if a behavior is at hand ( a new decal is spawned ) the message dispatcher class notes the event system that it should free this decal in 15 seconds ... how do i collect those data ? PS: The non-OO approach would be to "simply" have the entity send a message to itself - which free`s itself after a delay.
×
×
  • Create New...