Jump to content

Gandi

Members
  • Posts

    295
  • Joined

  • Last visited

Everything posted by Gandi

  1. that should also do it if you got the alpha channel used in the leaf texture.. alphatest sometimes got rough edges as it just skips the pixel with an alpha lower a specific value (dont know how much this was atm)
  2. Hi! I'm trying to set the intensity of my directional light to a value < 1.0 but it just doesnt seem to work.. im using: EntityColor(sun, Vec4(1.0,1.0,1.0,0.0)); but the light still gets rendered.. is there any other way for doing it (and plz dont say: HideEntity as i want to fade it out slowly..)
  3. Gandi

    Coronas

    Hi! I tried to implement a sun-billboard into my project.. as i couödnt find anything else i tried the corona.. but it doesnt work the way i want it to.. I want to set different appearance relative stuff in a shader. Im creating it like that: sun = CreateCorona(); SetCoronaRadius(sun, 1,2); PaintEntity(sun, "abstract::sun.mat"); PositionEntity(sun,Vec3(1,0,0)); so i checked the corona.frag shader.. this one was pretty confusing.. (why do you set the color at gl_FragData[3]. usually you use gl_FragData[0]..) my problems: if u just set the color in the frag shader its a black rectangle showing up.. also there is a little clipping problem as the corona disapperas when the center of it inst in the screen anymore.. hope some1 can help me.. Gandi
  4. Thx a lot! works fine now.
  5. Hi! im creating an image where i want to set the color of a pixel exactly.. so i created a 4x4 image for testing.. lets say every stripe is 1x4 pixel (don't mind the black border. its just for seeing the borders of the different versions) 1.) the image with the colors i want 2.) the image i get when using the TextureTools i DL'ed at the dl section of the forum 3.) the image i get when using nvidia dds tools with photoshop. as you can see i get several outputs, but not the one i want to get.. i want to get the color of the 1st texture. and now plz dont say i should just store the colors in my program, as i just used the 4 px for testing. this should have like 256x4 pixel later. is there any other format then dds i can use with LE. i just want to get the color information of the texture at a specific location in my shader.. greetings Gandi
  6. where's the sense of setting castshadows=0 and then defining a shadowshader? why it crashes? i dont know... yes.. i am creating a mesh. the minimum should be 9 i guess (otherwise the shader doesnt make sense.. 3 in each direction, so you got a 1x1 field for rendering your decal. I have to admit.. i dont know what whisper "did"?? Wireframe(1);
  7. sure.. it aint something secret.. decal.vert decal.frag i pretty much just copied the mesh.vert and mesh.frag and made some changes.. also didnt test it with parallax and bumpmap, etc..
  8. ok.. i just wrote a shader for terrain decals.. image1 image2 as you can see the vertices of the decal just align to the vertices of the terrain. now you maybe say: but what if i want to move it in smooth steps? heres the answer: image3 image4 at the pictures you can see the visible areas of my decal. i create the mesh with its size+1*terrainscale. so i got 2 triangle strips left as a buffer. when i now move the decal it moves the UV coordinates instead of the vertices until the distance moved is > then 1x terrainscale. in the pictures the red rectangle is the visible area and the blue one is the invisible. in picture 2 i moved the "mesh" a bit to the right, top corner. as you can see the mesh didnt really moved, but the visible area did. when the visible area would leave the mesh, the mesh moves +1xterrainscale. the shader i wrote basically does that: aligns the vertices to the terrain-grid moves the UV discards any pixel that has UV > 1 or <0 (can be changed by parsing a max UV value to the shader) the advantage of this system is, that it does all the work on the GPU that it aligns the decal perfectly to the terrain that it doesnt need that many vertices. disadvantage: decals atm cant be rotated i got some errors with clipping as the mesh's y-coordinate is stored as 0 and so it sometimes doesnt get rendered if you dont look straight down (should be solveable somehow )
  9. i have to admit i didnt read the whole post^^ but shouldnt the mesh shader with LW_MESHLAYER defined do exactly what you want?
  10. Blah Blah, my mum is definately better than your mum. Would you all please stop now and start working again?
  11. Gandi

    Progress Bar

    I dont really get what you are trying atm.. I was able to read all the models-paths and texture paths from a .sbx file.. then i loaded them all ans stored them in a container. after that i called the LoadScene() which should just create the terrain and place the models.. if i understood it right i dont have to split the file into two parts as: "If a model with the specified filename has already been loaded, it'll return a reference to that to avoid loading assets twice. " and "If a texture with the specified filename has already been loaded, it'll return a reference to that to avoid loading assets twice. " so shouldnt it take the pointers to the already loaded models/textures?
  12. Gandi

    crack in earth

    another way would be: 1) create the full mesh (with 100% size).. -apply the UV's so it fits when its 100% grown 2) create a shader which makes the crack visible depending on a variable you later parse to the shader.. something like if(texcoord.x<size) outputcolor.a=0.0; where size is a float that goes from 0 to the max. U value now all you have to do is update the size parameter depending on how fast you want your crack to grow.. so you dont have to update any mesh, and you could add something like a little alpha blending at the end of the crack. €: if you dont use the color of the mesh you could just for instance use the color.a value as the size, so you just have to change the color of the mesh at runtime..
  13. Gandi

    Progress Bar

    that sounds good ^^ problem is just: where do i know from how much i have loaded yet/how much is to be loaded, so i get the progressbar from 0%-100%....
  14. Gandi

    Progress Bar

    Hi! I'm trying to implement some kind of progress bar for loading my scene. My first attemt: Parsing the .sbx file and loading all the models/textures in the main thread separately und updating the image in between. seems to work.. but as soon as i call LoadScene (after loading all the models/textures) there still comes a huge "lag". Is there another way for something like that (i read multithreading doesnt work :-/ ) or any way of reducing this lag??
  15. Hi! I want to change the resolution of my window and fullscreen/normal screen. everything works fine as long as: 1) i dont change between fullscreen/windowed screen or 2) the new resolution is smaller then the old one ( then also fullscreen/windowed screen changes work) thats my code: void Resize(int w, int h, int d, int f, int flag) { int wa = GraphicsWidth(); int ha = GraphicsHeight(); ::Graphics(w,h,d,f, flag); if(wa==w && ha==h) return; std::vector<TBuffer> bu; for(uint i=0; i< buffer.size(); i++) { TBuffer b = CreateBuffer(w,h,flags[i]); bu.push_back(; FreeBuffer(buffer[i]); } buffer.swap(bu); bu.clear(); delete &bu; menu->SetSize(GraphicsWidth(), GraphicsHeight()); } buffer contains all my buffers and flags contains the buffer-flags..
  16. Yeah I know how to unzip files, but I thought this was an easy-to-implement and though useful function, so I made a request.
  17. I want to store game specific data in a .pak file which I load with the C++ ifstream. However, if I do something like: ifstream file; file.open(AbstractPath("abstract::myfile.txt")); it obviously doesn't work, because only the engine's LoadXY() - functions can read from zip-files. However, I'm pretty sure that the engine can already extract files from .pak's because of the cache:: - protocol, so something like ifstream file; //This returns the path of the cached file str path = CacheFile("abstract::myfile.txt"); file.open(path); Would be great^^
  18. LoadScene() should be irrelevant, I draw the image on the back buffer, then I display the back buffer on the monitor using Flip() ... or am I missing something here?
  19. Alphablending is off but it should not matter because i'm not rendering lights anyway. I just do: LoadScene() DrawImage( Loadingscreen ) Flip()
  20. Gandi

    Billboards

    Thanks a lot Gandi
  21. Hey, I've run into some really weird problem while implementing a loading screen. Once you start the game, you see the main menu and when clicking on "start game" it displays the loading state with a green bar while it loads the scene and game specific data (what an incredibly creative idea^^) My main loop looks basically like this: (pseudo code) while (!AppTerminate()) { switch ( GameState ) { case MainMenu: DrawMainMenu(); break; case LoadingScreen: LoadNextPiece(); DrawLoadingScreen(); break; case Ingame: UpdateFramework(); RenderFramework(); } Flip(); } Note that during loading stage, I'm not rendering _anything_ except the loading screen, which consists of two images... but it magically blends it with the terrain viewed from the top... I'll show a few images so you can see what I mean: This is the loading screen before LoadScene() gets called, looks pretty normal (except for the ugly loading bar^^) --- This is the loading screen after LoadScene() got called. The terrain you can see is the terrain of the scene loaded. Although this happens to look quite funny, it's definately not what I wanted and I have no idea how to fix this. Any help would be appreciated Gandi
  22. Gandi

    Billboards

    Hi! i want to create a plane, which is billboarded (rotating around its center) but i just dont get it to work is there any material / shader which does that for me? does it even work if a plane i created with CreatePlane() ?
  23. Okay, so I have to do this for all the internal buffers of Framework?
  24. So it should work if I simply do: Graphics(800,600); ... because in my case, the window is resized to the new resolution, but it is just plain black^^ I'm using framework and displaying a few images and texts. Do I have to reload those images?
  25. if you need some help.. i would like to i preffer doin graphical things like particles etc.
×
×
  • Create New...