Home › Forums › Development discussions › Future development
- This topic has 156 replies, 6 voices, and was last updated 9 years, 2 months ago by Sponk.
-
AuthorPosts
-
August 31, 2014 at 17:39 #233SponkKeymaster
Currently I’m creating Lua API calls as I need them in my game or in a editor plugin. Most of the things necessary for creating most things are done.
If you have ideas you can propose them here.
September 1, 2014 at 00:43 #234Akira_SanParticipantlua api: ReplaceObject() Useful when you want to replace the object with another one. Its sort of a shortcut to: delete the destroyed barrel, make a new clone(shattered barrel) and then, play destroyed barrel animation.
September 1, 2014 at 11:09 #235SponkKeymasterWhat’s wrong with writing this function in your Lua script?
function replaceObject(object, newMesh) newObject = loadMesh(newMesh) setPosition(newObject, getPosition(object)) setRotation(newObject, getRotation(object)) setScale(newObject, getScale(object)) updateMatrix(newObject) deleteObject(object) return newObject end
Then you could also set an animation as you suggested.
I think this function should reside in your personal code and not in the C++ core engine since it’s only using already available functionality. You can of course package your script as library and distribute it for others to use. That is the preferred way of getting this function to the public.
September 1, 2014 at 18:14 #236Akira_SanParticipantThats very nice. 🙂 I didnt thought of that! If i have a multiple of objects, then how do i do that?
September 1, 2014 at 18:55 #237SponkKeymasterThat’s easy. Just put them in a list and iterate through it:
local objectList = {} -- Do this with all objects you want to have. You only have to change "SomeObject" to the new name objectList[#objectList+1] = getObject("SomeObject") for i = 1, #objectList, 1 do -- Insert your mesh file here replaceObject(objectList[i], "meshs/somefile.mesh") end -- Set the list to nil so we can't try to access invalid pointers to objects -- That got deleted in "replaceObject" objectList = nil
- This reply was modified 10 years, 1 month ago by Sponk.
September 1, 2014 at 23:18 #238Akira_SanParticipantThank you!
What about some api, about highlights. When you hover the mouse over an object, the object starts to glow. I see on the other engine they have like: matcolor = material.color.red or replace_material = material.replace_shader(“glow.mat”)?September 2, 2014 at 14:07 #240SponkKeymasterMaterial options should not be problematic. Please open an issue for that on GitHub 🙂
September 2, 2014 at 23:25 #246September 3, 2014 at 18:05 #248SponkKeymasterWell, it could be done but I don’t think that it’s necessary right now since there would be hardly anyone using it 😀
If you need it a better way would be pre-baking it in Blender and using a custom GLSL shader. That would save rendering time each frame and give good results in almost all scenarios.
September 3, 2014 at 23:57 #249Akira_SanParticipantI see, any good websites for learning glsl?
September 4, 2014 at 11:05 #250SponkKeymasterNeHe of course: http://nehe.gamedev.net/article/glsl_an_introduction/25007/
Then the DGL wiki: http://wiki.delphigl.com/index.php/Tutorial_glslIt’s german but someone else may find it interesting 😀
This one is also nice: http://www.lighthouse3d.com/opengl/glsl/
I have a very basic environment mapping shader working. I can upload it if you want.
It’s just per-vertex but it’s simple and gives nice results.September 4, 2014 at 16:01 #251Akira_SanParticipantSure i could take a look. Are you planning to add some more lamps like a Sun lamp?
September 4, 2014 at 17:15 #252Akira_SanParticipantThx for the links, been reading the first link, now i have some understanding of the glsl shaders. 🙂 Although writing them is a long time task…
September 5, 2014 at 10:28 #253SponkKeymasterYep, GLSL shaders can take a long time to debug 😀
You can already use a directional light. Simply create a light, set it to spot-light and set the angle to 0 🙂
September 5, 2014 at 15:54 #255Akira_SanParticipantDamn, Maratis is hiding all of this functionality behind… I must say, thats not even user friendly.
-
AuthorPosts
- You must be logged in to reply to this topic.