Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. This is painfully slow. From 800 fps to 98 just to do the fft calculation (pure math, no water vertices drawn) How is this even usable outside fancy demos? Might work better offloading fft calculation in a second thread. Why havent anyone done all calculations on gpu?
  2. This is HLSL, so for float3/4 you want to use vec3/4, and saturate is same as clamp in GLSL. The math is basicly the same, but you have to translate the uniforms and attributes to match Leadwerks ones.
  3. Cool, I think this is a major improvement!
  4. Just multiply material color-selector to the cubemap texture... vec4(ex_color.rgb,1) so something like this probably outcolor = mix(outcolor,texture(texture4,cubecoord)*vec4(ex_color.rgb,1),outcolor.a);
  5. Thanks, still some issues to resolve but I got to see motion
  6. void cOcean::evaluateWavesFFT(float t, Leadwerks::Model* m) { if (m->CountSurfaces()>0 && m->GetSurface(0)->CountVertices() == 0) { int index; Surface* surface = m->GetSurface(0); //Set up water patch for vertices for (int m_prime = 0; m_prime < N; m_prime++) { for (int n_prime = 0; n_prime < N; n_prime++) { index = m_prime * Nplus1 + n_prime; surface->AddVertex(vertices[index].ox, vertices[index].oy, vertices[index].oz); } } for (int m_prime = 0; m_prime < N; m_prime++) { for (int n_prime = 0; n_prime < N; n_prime++) { //surface->AddTriangle(...); //HOW??? } } } } Any tip?
  7. You can also store data on entities which can be set/retrieved from both ends, using SetKeyValue GetKeyValue.
  8. If camera and world was created in c++ you can do something like this to pick it up in lua : local world=World:GetCurrent() for i=0,world:CountEntities() do if world:GetEntity(i):GetClass()==Object.CameraClass then self.camera=world:GetEntity(i) break end end
  9. For collaboration yes. Privately I use git and a NAS.
  10. Thanks got it, had a htilde instead of hTilde
  11. Github for both code and assets, it's really great once you get use to it. Best diff tools and branching I've ever used. https://github.com/shadmar
  12. Well it's keiths ocean class here : http://www.keithlantz.net/2011/10/ocean-simulation-part-one-using-the-discrete-fourier-transform/ I'm giving a FFT water a go if I figure out how to compile his classes and adapt to Leadwerks. This is the class: class cOcean { private: bool geometry; // flag to render geometry or surface float g; // gravity constant int N, Nplus1; // dimension -- N should be a power of 2 float A; // phillips spectrum parameter -- affects heights of waves vector2 w; // wind parameter float length; // length parameter complex *h_tilde, // for fast fourier transform *h_tilde_slopex, *h_tilde_slopez, *h_tilde_dx, *h_tilde_dz; cFFT *fft; // fast fourier transform vertex_ocean *vertices; // vertices for vertex buffer object unsigned int *indices; // indicies for vertex buffer object unsigned int indices_count; // number of indices to render //GLuint vbo_vertices, vbo_indices; // vertex buffer objects //GLuint glProgram, glShaderV, glShaderF; // shaders //GLint vertex, normal, texture, light_position, projection, view, model; // attributes and uniforms protected: public: cOcean(const int N, const float A, const vector2 w, const float length, bool geometry); ~cOcean(); void release(); float dispersion(int n_prime, int m_prime); // deep water float phillips(int n_prime, int m_prime); // phillips spectrum complex hTilde_0(int n_prime, int m_prime); complex hTilde(float t, int n_prime, int m_prime); complex_vector_normal h_D_and_n(vector2 x, float t); void evaluateWaves(float t); void evaluateWavesFFT(float t); //void render(float t, glm::vec3 light_pos, glm::mat4 Projection, glm::mat4 View, glm::mat4 Model, bool use_fft); };
  13. How do I go finding what is wrong with this, I have no external libs dependencies, just a class called complex which defines a datatype for a public member in the co class. I can't seem to figure it out. Error 3 error LNK2001: unresolved external symbol "public: class complex __thiscall co::hTilde_0(int,int)" (?hTilde_0@co@@QAE?AVcomplex@@HH@Z) C:\Users\Documents\Leadwerks\Projects\cpp_co\Projects\Windows\co.obj cpp_co Any tip?
  14. If someone is willing to build me a lightmapped scene, I can provide shaders for it.
  15. You can convert it. It's in the LE2 downloads somewhere. Refracting ocean.
  16. Newton supports vehicle physics, but there is no exposure though the LE API (yet).
  17. $50 a month or $795 to buy on their website. http://www.autodesk.com/products/maya-lt/buy
  18. Dont use smoothing groups on export or just recalculate normals in LE model editor.
  19. Leadwerks saves it as A8R8G8B8 dds texture with mipmaps uncompressed ( I think )
  20. No it did(does) lighting/shadow from sources and ambient occlusion.
  21. Convert box to sphere function (vertex operation) added : http://leadwerks.wikidot.com/wiki:spherify-function
  22. Make me a lightmapped blender scene for test.
  23. Yes, you can actually lightmap using CSG in 3.0 and re-use them in 3.1, but you need a set of lightmap-shaders which will run in 3.1 I did a superquick test (all lightmapped in 3.0 and loaded in 3.1), but there could be problems in a more complex scene (and it's not a very smooth workflow using 2 editors)
  24. That is a copy/paste bug probably (remove/comment out these lines from the shader) : uniform sampler2D texture1;//normal map uniform sampler2D texture2;//specular map normal = texture(texture1,ex_texcoords0).xyz * 2.0 - 1.0; normal = ex_tangent*normal.x + ex_binormal*normal.y + ex_normal*normal.z;
×
×
  • Create New...