Jump to content

Ma-Shell

Members
  • Posts

    371
  • Joined

  • Last visited

Everything posted by Ma-Shell

  1. Still no support for xserver 1.17! They will never get back to the official arch-repos...
  2. The microsoft compiler has some settings for optimization. You will find them in VS 2013 by clicking Debug -> [Project name] properties... -> Configuration Properties -> C/C++ -> Optimization You should set the value of "Optimization" to "Maximize Speed (/O2)" and "Favor Size Or Speed" to "Favor fast code (/Ot)". I am not sure, whether the other settings will also have a noticeable impact but these should be the most important ones. Be sure to select the "Release"-Configuration in the Combobox at the top of the dialog window.
  3. Just because something isn't intuitive is no reason to abandon it. e.g. take blender: When you first use this tool you have absolutely no clue, what to do but once you get used to it, you will see, that it is designed to save loads of time! Another very important example for this is the command-line-editor vim. Hell, you will curse it a thousand times but if you take the time to actually learn to master it, you can be so much faster than with any other text-editor! I think, that the potential to be extremely fast is more important than intuitivity. But these things can go along with each other. Just have it enter the name automatically into the field, if you drag it and everyone is happy...
  4. There is no difference between LUA and C++ projects anymore. If you own the C++-DLC, every new project you create will include a C++-project and sources.
  5. He means a map. Translation error... At least in german map=Karte=card. This won't load your map. You need this: http://www.leadwerks.com/werkspace/page/api-reference/_/map/mapload-r510
  6. Most of these values are printed, if you call self.context:DrawStats(10, 10, true) [LUA] context->DrawStats(10, 10, true) [C++] The third parameter ("extra") set to "true" instead of the default value "false" gives more output, which includes most of the values you mentioned.
  7. The function signature is as it is written in the reference (only 5 parameters). You can access the individual components as position[0], position[1], position[2] normal[0], normal[2], normal[3]
  8. They seem to have a problem with FBOs. See this thread: http://www.leadwerks.com/werkspace/topic/12058-performance-issues/page__st__20
  9. You also have to make your functions in the base class "pure virtual". This is done by setting them to 0. The function from the base-class should read: virtual void Collision(Entity* entity, float* position, float* normal, float speed)=0; For more info on the difference between virtual and pure virtual refer to http://stackoverflow.com/questions/1306778/c-virtual-pure-virtual-explained
  10. You will also have to override ALL the other virtual functions of the parent-class, if you want a class which is not virtual.
  11. In your derived PlayerScript-class, you defined your methods as "virtual", which they aren't. They are only "virtual" in their parent-class. The compiler is searching for their implementations, which it can't find. Just leave out the "virtual"-keyword in the PlayerScript-class
  12. What do you mean with "without interrupting anything"? You can get the mouse wheel as the z-coordinate of the GetMousePosition()-function (http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/window/windowgetmouseposition-r455)
  13. How about categorising the non essential files and treating them like workshop-items, so you can choose whether to include them or not.
  14. http://www.leadwerks.com/werkspace/files/category/39-leadwerks-2/ http://www.leadwerks.com/werkspace/files/file/186-leadwerks-engine-updater/ Community-Wiki: http://leadwerks.wikidot.com/wiki:tutorials Official Stuff: http://www.leadwerks.com/werkspace/page/documentation
  15. You need to add the FPSPlayer-prefab. If it isn't in your project-folder, you can get it from the MyGame-project (located in \Steam\steamapps\common\Leadwerks\MyGame).
  16. Just parent the box to the camera. No code needed.
  17. Not really sure, what you are asking. Do you want to draw an image with an alpha-value above your rendered image? In that case the following code should do the trick: int blendModeOld = context->GetBlendMode(); context->SetBlendMode(Blend::Alpha); context->DrawImage(...); context->SetBlendMode(blendModeOld);
  18. I don't really understand the question but I guess it's about the relationship between Context and Buffer. The Context-class inherits from / extends / is a sub-class of the Buffer-class, so basically the context is a special sort of buffer.
  19. For all available methods you should take a look at [LeadwerksInstallDir]/Include/Classes/Buffer.h. You can easily bring it up by pressing "Ctrl"+"," in Visual Studio and then typing "Buffer".
  20. You can look at the files I posted over there: http://www.leadwerks.com/werkspace/topic/11579-3d-screen-mode-for-3d-glasses/#entry83580 If you open the StereoRender.cpp from the zip-file, you can see, how you can use buffers. Basically that file creates a Buffer called "leftEye" by using: Buffer* leftEye = Buffer::Create(context->GetWidth() + 1, context->GetHeight(), 1, 1, 0); This buffer can be cleared by leftEye->Clear() Rendering to this Buffer is done by: context->Disable(); leftEye->Enable(); world->Render(); leftEye->Disable(); context->Enable(); The example then draws the leftEye-image over the context's image by using int blendModeOld = context->GetBlendMode(); context->SetBlendMode(Blend::Alpha); context->DrawImage(leftEye->GetColorTexture(), 0, 0, context->GetWidth()+1, context->GetHeight()+1); context->SetBlendMode(blendModeOld);
  21. First you have to create a new shader with the given code. To do that navigate to "Shaders/PostEffects" in the "Assets"-Tab. Right-Click on the dark grey area and choose "New"->"Shader" Give it a name, e.g. "rain" Double-Click the newly created file. The script-editor should open. Navigate to the Vertex-Shader by pressing "Vertex" in the white area on the left of the script-editor and paste the Vertex-Shader-Code Navigate to the Fragment-Shader by pressing "Fragment" and paste the Fragment-Shader-Code and save. Close the script-editor and select the Root-Object in the "Scene"-tab Under "Post Effects" add the newly created shader Select your camera and check the "Use Post-Effects"-Checkbox in the "Camera"-Tab
  22. @Rick No, it doesn't. I agree, that would be quite cool but I think, we would need higher powers (shadmar ) to achieve that
  23. You might want to try this PostFx-Shader I derived from http://glsl.herokuapp.com/e#14949.0 You might want to play around with some of the values but I think, it's a good start. Vertex-Shader: #version 400 uniform mat4 projectionmatrix; uniform mat4 drawmatrix; uniform vec2 offset; uniform vec2 position[4]; in vec3 vertex_position; void main(void) { gl_Position = projectionmatrix * (drawmatrix * vec4(position[gl_VertexID]+offset, 0.0, 1.0)); } Fragment-Shader: #version 400 float torad(float deg){ return deg*3.14/180; } uniform bool isbackbuffer; uniform float currenttime; uniform vec2 buffersize; uniform sampler2D texture1; out vec4 fragData0; uniform mat4 projectioncameramatrix; void main( void ) { vec2 tcoord = vec2(gl_FragCoord.xy/buffersize); if (isbackbuffer) tcoord.y = 1.0 - tcoord.y; float aspect = buffersize.y/buffersize.x; tcoord.x = clamp(tcoord.x,0.0,1.0); tcoord.y = clamp(tcoord.y,0.0,1.0); vec2 position = ( gl_FragCoord.xy - buffersize.xy*.5 ) / buffersize.x; position.y+=projectioncameramatrix[1][3]; position.y-=1.0; // 256 angle steps float angle = atan(position.y,position.x)/(2.*3.14159265359); angle -= floor(angle); float rad = length(position); float color = 0.0; for (int i = 0; i < 10; i++) { float angleFract = fract(angle*256.); float angleRnd = floor(angle*256.)+1.; float angleRnd1 = fract(angleRnd*fract(angleRnd*.7235)*45.1); float angleRnd2 = fract(angleRnd*fract(angleRnd*.82657)*13.724); float t = currenttime*.005+angleRnd1*10.; float radDist = sqrt(angleRnd2+float(i)); float adist = radDist/rad*.1; float dist = (t*.1+adist); dist = abs(fract(dist)-.5); color += max(0.,.5-dist*40./adist)*(.5-abs(angleFract-.5))*5./adist/radDist; angle = fract(angle+.61); } fragData0 = texture(texture1,tcoord); fragData0 += vec4( color )*.3; }
  24. http://www.leadwerks.com/werkspace/topic/10628-shared-lib-libsteam-apiso-loading-question/
  25. Instead of the Express-Edition you can also use the Community-Edition. It's free as well and it adds some nice things (e.g. the support for plugins; long live the vim-plugin ).
×
×
  • Create New...