Ma-Shell
-
Posts
371 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Ma-Shell
-
-
Not sure what a card is...
He means a map. Translation error... At least in german map=Karte=card.
Hello! There was such problem. Created a card with the sky and water. I load it using the following: std:: string mapname = System:: GetProperty ("map", "Maps/my_map_01.map"). I start compilation and at me it is not visible the sky. What do I do not so?
This won't load your map.
You need this:
http://www.leadwerks.com/werkspace/page/api-reference/_/map/mapload-r510
-
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.
- 1
-
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]
- 1
-
They seem to have a problem with FBOs.
See this thread:
http://www.leadwerks.com/werkspace/topic/12058-performance-issues/page__st__20
-
All of this new AMDGPU code is explicitly about the Tonga GPUs and future hardware. Users of existing Radeon GPUs will still be using the current Radeon DRM driver that will still be maintained by AMD.
Meh...
-
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
- 1
-
You will also have to override ALL the other virtual functions of the parent-class, if you want a class which is not virtual.
-
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
-
What do you mean with "without interrupting anything"?
You can get the mouse wheel as the z-coordinate of the GetMousePosition()-function
-
How about categorising the non essential files and treating them like workshop-items, so you can choose whether to include them or not.
- 2
-
1. LE 2.5 downloads - shaders, assets, scripts, textures and other community driven each and every things.
http://www.leadwerks.com/werkspace/files/category/39-leadwerks-2/
2/ LE 2.5 engine downloader.
http://www.leadwerks.com/werkspace/files/file/186-leadwerks-engine-updater/
3. Community wikis, official tutorials, docs,
Community-Wiki:
http://leadwerks.wikidot.com/wiki:tutorials
Official Stuff:
-
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).
- 1
-
Just parent the box to the camera. No code needed.
-
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);
-
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.
-
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".
- 1
-
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);
- 2
-
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
- 1
- 1
- To do that navigate to "Shaders/PostEffects" in the "Assets"-Tab.
-
@Rick
No, it doesn't. I agree, that would be quite cool but I think, we would need higher powers (shadmar ) to achieve that
-
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; }
- 1
-
-
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 ).
- 1
-
Is there a log-file in your documents/Leadwerks - folder?
If so, maybe it contains a hint to what could be wrong.
You don't need visual studio to start Leadwerks, but you need it (and especially its compiler) for C++-projects
-
If you only want to make a pretty basic waterfall, a simple texture-scrolling could be enough.
Refer to this thread for more infos on that:
http://www.leadwerks.com/werkspace/topic/11874-piping-water-flux-anim-texture/
C++ project How to
in Programming
Posted
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.