-
Posts
382 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by tipforeveryone
-
-
Finally I found the solution for this problem.
it is not related to Leadwerks, there was a process named "Rivet Networks Dynamic bandwidth manager" which running on my laptop.
The process made CPU run at unstable rate which caused stutter problem.
-
yesterday my Leadwerks was still normal, but today, I get this problem with FPS, anyone has any idea about which caused this ?
-
Bullet Physic with gravity, now sniping is much more fun
- 1
-
I am trying to build a Top view shooting game
First I use Camera:Pick to get collided position by Mouse pointer to Terrain, everything ok, System:Print() can make output of collided position
--set shooting point follow mouse cursor mousepos = window:GetMousePosition() mousePickInfo = PickInfo() if camera:Pick(mousepos.x,mousepos.y,mousePickInfo,0,true,Collision.LineOfSight) then shootingPoint:SetPosition(mousePickInfo.position) --shootingPoint is a pivot which I created in Script:Start() System:Print(mousePickInfo.position) end
Then I create a ray from player position to mousePickInfo.position then there is problem, the ray can not collide some areas of terrain and return 0,0,0 position, a height map was imported to construct terrain
bulletPickInfo = PickInfo() world:Pick( body:GetPosition(true), mousePickInfo.position, bulletPickInfo,0.2,true,Collision.LineOfSight )
I use a context:DrawLine to visualize the ray, and here the video, notice that when I move the mouse, sometime the red line changes its end point
-
I mean you can apply a material which uses emission shader only for that part of mesh (where is the light position)
then use entity:GetSurface() to change the light's stages
-
Use material with emission shader, only for that light
-
you can add a specular map to your material, that will look better than just reducing specular color.
Use photoshop to make that specular map from diffuse by black and white command, then adjust contrast.
-
You can get the length of animation by using entity:GetAnimationLength()
Then how to get the current frame of an animation, I want to play a sound in the middle of animation so that I need that. Please show me Thanks
-
I dont feel any diffirence between these functions in final resuilt when applying to a camera. So there is any way to know when to use Zoom or FOV ?
-
Maybe you should right-click on the viewport then check out RenderMode
-
I have this problem on 4.6 sometimes, my suggestion is using stable 4.5 instead
-
I use this for my weapon blocking (by wall) system, I think it will work with your camera
- You can calculate the distance between the pickInfo.position and the entity which you put start of Pick (Beam Point 1)
- then use the maximum range of your camera to player (self.defaultCameraRange) minus that, you get the distance between MaxRange to pickInfo.position (called self.collisionMinusRange)
- Because camera point its Z axis to player, so that you can use entity:Move(0,0,self.collisionMinusRange)
- In the meantime, Use camera:SetPosition(self.beamPoint2:GetPosition(true)) to keep you camera at the maxRange when not collided any obstacle
Hope you can understand what I am trying to explain
- 1
- 2
-
You can modify the code and make it work I think, because this function was used in my hand-made PlayerScript then I am not sure it will work on default AI / Player scripts of leadwerks.
-
target in my function should be an entity, dont try it with Vec3() value
-
I have a small function which can help you to define if an entity is inside a cone view of another entity.
function CheckConeView(axis,entity,target,angle) local z,u if axis == "x" then z = Transform:Point(Vec3(1,0,0),entity,nil) elseif axis == "y" then z = Transform:Point(Vec3(0,1,0),entity,nil) elseif axis == "z" then z = Transform:Point(Vec3(0,0,1),entity,nil) end u = Transform:Point(target:GetPosition(true),nil,entity) z = Transform:Point(z,nil,entity) local targetAngle = Math:ACos(u:Dot(z)/(u:Length()*z:Length())) if targetAngle < angle/2 then return true else return false end end
This should be made as global function, then you can use this as below
function Script:PostRender() if CheckConeView("z",self.yourPlayerCamera,self.target,90) and self.targetInRange == true then --display health bar code end end
hope this make your idea possible
-
Anyone has an example of this shader usage ? I mean a collection of All texture maps which can combine together on an object. which texture slot should I put those textures into ?
By the way, Is there any tutorial which shows me how to create parallax / roughness for leadwerks
-
Please @Josh can you make ssr depens on specular map ?
-
Why dont you use all of the methods :"D I have an unique FPSPlayer Control which was built from scratch, kind of useful then I share it via my blog on this site.
-
Thank you @macklebee this is so clear ! I wonder why there are many functions like this not in document, maybe they are unofficial but still being used in default code somewhere, making everybody confused
-
Nouse. they are still shiny like hell : ))
-
Wow that UI ! what an art !
-
I found this in default FPSPlayer.lua while testing Joint:Kinematic but had no idea what was it usage
-
I use a material which has all 3 textures: diffuse, normal, specular then add ssr.shader to my camera
As I expect, the reflection should follow specular map to reflect scene around my object, but it doesn't. When ssr was enabled, everything was reflected on that object's face.
Adjust RGB value of Specular is the only one way to control how much reflection on that object
But when it comes almost black (to reduce reflection) specular map becomes more useless
Is there any way to really control ssr with specular map ?
-
You can create a simple function which helps you to convert 0-255 to 0-1
function rgba(r,g,b,a) --red green blue alpha, it is like CSS local rgba_value = Vec4(r/255,g/255,b/255,a) return rgba_value end --make this function global then you can use entity:SetColor(rgba(142,36,64,0.8))
- 1
Animation problem
in General Discussion
Posted
You must use bones (and meshes parented to them as auto weight) to export animation. Export both mesh and its bones. Then applying shader which used for animation on materials of the mesh.