Jump to content

Masterxilo

Members
  • Posts

    379
  • Joined

  • Last visited

Everything posted by Masterxilo

  1. Were you able to solve this? What about the calling convention (needs to be __stdcall)? Is it set correctly?
  2. You can even parent entities in different world to each other. This is important for having transparent parts (e.g. the windows of a car) stay with the object.
  3. I shouldn't have relied on the forum turning http://urls automatically into links and better made it a link myself @Flexman You shouldn't have more than one visible camera at any given time. Or weren't both of them visible when you got the described effects?
  4. Further extending my first comment, and after having played around with my already nicely converted articles, I have to say that this looks much better than the old system, the wiki, and the pdfs. The new website design template with fixed width and a darker header looks infinitely better than the dull gray of the forum design, I hope this'll chanage here too (well the non fixed width is ok, but really, the color...).
  5. Indeed, that is an advantage. The editor should support per-object dll's ...
  6. To the OP: You load the level/scene and this loads the terrain and prepares (or executes?) model loading. The object's meshes are loaded when they first come into view afaik (maybe this is only with shaders and materials, maybe all the objects/meshes get loaded when loading the map initially). You don't need to do anything manually (unless you want to). There's no unloading. You cannot and the engine doesn't do this. Therefore, there are no properties for anything like streamed loading in the editor. What the engine does is it loads you level and there you go, that's it. No need to worry about (un)loading stuff but also none of the advantages (less memory usage, faster initial loading) of it.
  7. It is easy to change this in the script. But I'm not sure whether this gives the look you want:
  8. Yeah, this is a pretty standard tool. ++
  9. There must be a valid gl context before you can create an LE world or load anything. So either make sure you call the LEO::Create method with the large amount of parameters or call LEO::InitGraphics in some other way (in)directly. As for the forum account, you should be able to get full access no matter what version of the engine you have. Just ask Josh(http://leadwerks.com/werkspace/index.php?/topic/127-if-you-need-access-to-the-forum/).
  10. And you should really request your forum account to be upgraded and post this in the programming section.
  11. Masterxilo

    smak

    xNormal seems to be a tool that does similar things (http://www.xnormal.net/Faq.aspx). It's free of charge.
  12. Some things changed weirdly in the log hardware info output lately. For example, prior to 2.3, the log always read "Conditional render supported: 1", not "0" for me...
  13. Check the sample @ http://www.leadwerks.com/wiki/index.php?title=OcclusionCulling. Make sure you enable occlusion culling for the objects you want to use it with EntityOcclusionMode. It's off by default for non animated objects/meshes. It's on for lights. However, it looks like it doesn't take into account the terrain so it can't be used to hide buildings in a valley...
  14. In the vertex shader, add: varying vec3 modelnormal; in the declarations before the code. Then in the code, after "modelvertex = ": modelnormal = nmat * gl_Normal; Now go to the frag shader and extend the declaration of the cube map to this: #ifdef LW_CUBEMAP uniform samplerCube LW_CUBEMAP; uniform float cubemapIntensity = 1.0; varying vec3 modelnormal; #endif and extend: //Diffuse gl_FragData[0] = diffuse; to //Diffuse #ifdef LW_CUBEMAP // Add cubemap diffuse = mix(diffuse, textureCube(LW_CUBEMAP, reflect(normalize(cameraposition - vertexposition.xyz), normalize(modelnormal)) * vec3(1.0,-1.0,1.0)), cubemapIntensity); #endif gl_FragData[0] = diffuse; Now the only thing left to do is the declaration of an "intermediate" (= include) shader. Mine looks like: // Requires meshModelnormal.vert #define LW_DIFFUSE texture0 #define LW_CUBEMAP texture3 Include "abstract::meshCubemap.frag" And is called mesh_diffuse_cubemap.frag This should do the trick (it does for 2.32, shouldn't be much different in 2.28).
  15. The physics/newton & LE water plane implementation only allows for one infinite waterplane...
  16. What about Shader::Disable() ==> SetShader(NULL); ?
  17. WOOt! All bugs in the tracker are gone. (EDIT: At least the Pending ones, CONFIRMED ones to go) Great. Thanks for this!
  18. It's actually quite easily possible to get all that info by just retrieving the ogl id of the shader by setting it and getting the current shader program. You can then get the name and type of each uniform defined in the shader. And you can also get the current value of any uniform with known name (http://forum.leadwerks.com/viewtopic.php?f=16&t=3109). This class extends the LEO::Shader class and implements the mentioned functionality: #pragma once #include "eleoCommon.h" ELEO_NAMESPACE_BEGIN struct Uniform { std::string name; GLint size; /* Any of GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4, GL_INT, GL_INT_VEC2, GL_INT_VEC3, GL_INT_VEC4, GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4, GL_FLOAT_MAT2, GL_FLOAT_MAT3, GL_FLOAT_MAT4, GL_FLOAT_MAT2x3, GL_FLOAT_MAT2x4, GL_FLOAT_MAT3x2, GL_FLOAT_MAT3x4, GL_FLOAT_MAT4x2, GL_FLOAT_MAT4x3, GL_SAMPLER_1D, GL_SAMPLER_2D, GL_SAMPLER_3D, GL_SAMPLER_CUBE, GL_SAMPLER_1D_SHADOW, GL_SAMPLER_2D_SHADOW See http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniform.xml*/ GLenum type; }; class EShader : public LEO::Shader { public: EShader( TEntity buf = NULL) : LEO::Shader(buf) {m_glProgram = -1;} void LoadPostfilter(const std::string& fragshader, const std::string& defines = "") { EShader::Load("abstract::postfilter.vert", fragshader, defines); } void Load( const std::string& vertpath, const std::string& fragpath, const std::string& defines = "" ) { __super::Load(vertpath, fragpath, defines); GrabGLInfo(); } const std::list<Uniform>& GetUniforms() const {return m_uniforms;} void GetUniformf(const std::string& uniformname, GLfloat* flts) const { glGetUniformfv(m_glProgram, glGetUniformLocation(m_glProgram, uniformname.c_str()), flts); } void GetUniformi(const std::string& uniformname, GLint* ints) const { glGetUniformiv(m_glProgram, glGetUniformLocation(m_glProgram, uniformname.c_str()), ints); } bool IsValid() {return __super::IsValid() && glIsProgram(m_glProgram);} private: void GrabGLInfo() { Set(); glGetIntegerv(GL_CURRENT_PROGRAM, &m_glProgram); GLint iUniforms; glGetProgramiv(m_glProgram, GL_ACTIVE_UNIFORMS, &iUniforms); for (int i = 0; i < iUniforms; i++) { Uniform uniform; GLint x; char namebuffer[200] = {0}; glGetActiveUniform (m_glProgram, i, sizeof(namebuffer), NULL, &uniform.size, &uniform.type, namebuffer); uniform.name = namebuffer; m_uniforms.push_back(uniform); } Set(false); } GLint m_glProgram; std::list<Uniform> m_uniforms; }; ELEO_NAMESPACE_END Just thought I might share. This is very handy for testing and tweaking shaders without manually copying the uniform names, types and default values to the program:
×
×
  • Create New...