Jump to content

Gandi

Members
  • Posts

    295
  • Joined

  • Last visited

Everything posted by Gandi

  1. Gandi

    Decals

    I spent the last day on creating a terrain-decal script for the LE Editor. the benefits of my system are: the density of vertices is depending on the scale of the terrain. So if the terrain has scale of 2meters my decal also got a scale of 2 meters. the vertices are updated on the cpu, but only if they are being manipulated. so after placing the decal no more computations are needed for it. FPS decrease when manipulating a big decal, but if you dont move/scale/rotate it theres no change of frames. Some Questions: How can i archieve, that when clicking on the decal it selects the decal, just like the road? €: Posted my code in the download section Please report any bugs to me. have fun
  2. Gandi

    Documentation

    I Got a model and i painted a material to that model (the model is self.mesh) now i want to set the texture0 of that material (SetMaterialTexture() in C) and im sure its self.mesh im just not sure if i get the mesh's material with self.mesh.material and i know there is 1 line of code missing.. thats the line where i set the texture
  3. It seems like there is a lack of documentation for lua :-/ Im trying to set the texture of a material in the editor. atm i got: local material = self.mesh.material local tex = LoadTexture("abstract::"..value) but i just cant find the command for setting the texture of the material.. another question: I create my mesh with lua (like the road) and i want to be able to select the entity by clicking on the plane. how can i get to that?
  4. Gandi

    Questions

    maybe that helps.. Click me!
  5. Gandi

    Questions

    how what works? SetVertexNormal sets the Normal of a Vertex?? TSurface is the surface of the model the integer says which Vertex you want to edit and the Vec3 is the Normal you assign.
  6. guess you will have to move the grass into the transparency layer..
  7. For waterfall particles may be a better solution (never tried it) for water, you will have to create your plane in the transparency world then there are 2 ways that come to my mind for texture animation. 1) Always pass 2 textures to the shader. each representing a frame. then you blend those 2 textures according to the apptime. now you have to pass the right 2 textures from your code. 2) just update the UV-coordinates in the shader. do you want to create realistic looking water, or a bit cartoonish style-water?
  8. Gandi

    Progress Bar

    How did you manage it? did you just estimate the time it will take and then move the bar according to that, or do you process the sbx file by yourself?
  9. so, is there a way of doing that (josh?)
  10. Sorry for double post, but i'm still interested in how you managed to disable the clipping for the grass-layer?
  11. what happens if i got an instanced model and change the bone-position on one of them? would all the models have the bone changed??
  12. The first step into the right direction would be: learning glsl instead of hlsl I'm not at home atm but maybe ill take a look at the water shader when in back again.
  13. try: blend = alpha in your mat file instead of using alphatest (alphatest clips all pixels with alpha value < 0.2 i think)
  14. Ok.. I managed it.. if some1 is interested: #include <engine.h> #include <gl/gl.h> #include <gl/glu.h> namespace Clockwise { class LECustomWindow { public: LECustomWindow(HWND window); TBuffer GetBackBuffer(); int GetWidth(); int GetHeight(); virtual void SetSize(int width, int height); void Flip(); protected: static void _stdcall makeCurrent(void); static void _stdcall getSize(int* width, int* height); TBuffer BackBuffer; TWorld World; int Width; int Height; }; } #include "LECustomWindow.h" #include <iostream> namespace Clockwise { HDC hDC; HGLRC hRC; void _stdcall LECustomWindow::makeCurrent(void) { wglMakeCurrent( hDC, hRC ); } void _stdcall LECustomWindow::getSize(int* width, int* height) { makeCurrent(); int vPort[4]; glGetIntegerv(GL_VIEWPORT, vPort); *width = vPort[2]; *height = vPort[3]; } void LECustomWindow::SetSize(int width, int height) { Width=width; Height=height; glViewport(0,0,Width,Height); } LECustomWindow::LECustomWindow(HWND window) { hDC=0;hRC=0; PIXELFORMATDESCRIPTOR pfd; int iFormat; hDC = GetDC( window ); ZeroMemory( &pfd, sizeof( pfd ) ); pfd.nSize = sizeof( pfd ); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; pfd.iPixelType = PFD_TYPE_RGBA; pfd.cColorBits = 32; pfd.cAlphaBits = 8; pfd.cDepthBits = 16; pfd.iLayerType = PFD_MAIN_PLANE; iFormat = ChoosePixelFormat( hDC, &pfd ); SetPixelFormat( hDC, iFormat, &pfd ); hRC = wglCreateContext( hDC ); wglMakeCurrent( hDC, hRC ); SetSize(800,600); World = CreateWorld(); BackBuffer = CreateCustomBuffer((byte*)&getSize,(byte*)&makeCurrent); SetBuffer(BackBuffer); glEnable(GL_DEPTH_TEST); } TBuffer LECustomWindow::GetBackBuffer() { return BackBuffer; } int LECustomWindow::GetWidth() { return Width; } int LECustomWindow::GetHeight() { return Height; } void LECustomWindow::Flip() { std::cout<<"FLIP"<<std::endl; SwapBuffers(hDC); } } I know, i got some not really good stuff in the code, but i also had to play around a bit to get it to work..
  15. Is there a way of resizing the backbuffer without calling the Graphics() method? I would be also happy with some OpenGL commands for doing it.. I just cant call Graphics() as this seems to create a ned HWND every time, and im using the window as a Child... I got no problem with resizing the rest of the buffers, but im really stuck with the backbuffer.. if noone has a clue i guess, ill just make a backbuffer with screensize and rendering only the visible part, but thats not really the way I'd like to do it if not necessary €: I tried "glViewport(0, 0, width, height);" but that doesnt seem to do anything..
  16. I'm making it for one of my projects.. dont like it if all the trees look the same direction..
  17. I thought about creating some kind of tree-creator, which takes a model (created with the gmf-sdk) and the places the bones in the right position (forming the tree) now my question: how would i do the LOD best? i guess billboards wont work like that (the model are just vertices and bones placed at 0/0/0 as i place them at runtime) i guess making the LOD will be best if i create, for instance, 3 versions of each tree (each with less vertices then the one before) and then creating one billboard for each tree-type hoping this will not cause a too big graphical artifact.. so to repeat: i got the modeler where i can define several parameters of the tree and which creates the .gmf file just containing rings of vertices with a bone (or 3 gmf files each with less vertices?) at runtime i place the bones according to the parameters i set at the modeller (for all 3 models?) then i create 1 tree for each type which i use for creating the billboard.. does anyone have a better idea??
  18. so how are you doin it with the vegetation? there you also set the y-value in the shader?
  19. Hi! I have a small mesh, which i scale/position in my shader.. works fine so far.. the problem is, that it doesnt get rendered if i dont look at the "original" position of the mesh (it doesnt take into account the position given in the shader). is there a way of turning of this disappearing-effect?
  20. Just wanted to ask if you are going to make some kind of tropical (or what would be even better: Oceania) plants package. I would buy instantly^^ XFrog Plants Oceania seems to be the only good Oceania pack out there... so you would bridge a gap in the market
  21. and how should i use the new file afterwards? CreateDirectionalLight() creates a directional light, but how should i e.g. create a directionallight which uses my shader?
  22. y.. but i dont want to overwrite a light i want to add an extra one!! so i want to use all light types + my new one..
  23. Hi! I was thinkin about adding a new light type which also gets rendered in the render lights pass.. now my question: is that even possible, or do i have to do it like some kind of post-process effect?? i fear that it aint possible that easy, but it would really be better if i could use it as a light...
  24. i dont really know the water shader.. but it also works this way: a shader with 2 textures and a float saving a value from 0.0-1.0. the shader now does the following: blending the two textures according to the value of the float. in your program you know have to set the textures and the float value.. the textures are always the current and the next frame of the animation. the float value kinda is a modulo value which increases depending on the speed of the animation.. this way you now should get smooth transitions between the frames of the animation like that: you want your texture (with 3 frames (tex1.dds, tex2.dds, tex3.dds)) to change every second. start: texture1 = tex1.dds texture2 = tex2.dds float = 0.0 updating the float each frame until the time to the last framechange = 1 second, then: texture1 = tex2.dds texture2 = tex3.dds float = 0.0 ...... i think the caustics kinda work like that..
  25. I think things like mirrors will need a lot of performance.. only thing i can think about is rendering the whole scene a second time, just using another camera (facing perpendicular to the surface of the mirror) rendering this scene to its own buffer and then applying the color-buffer to the mirror as a texture.. but as you see, rendering everything a second time (for one mirror) will not be very performant.. maybe there's a better way, but i dont know how..
×
×
  • Create New...