-
Posts
43 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by norbert
-
How do I access the camera in C++ when loading the map start.ultra? The hang is created in the ThirdPersonControls component and attached to the players. Is there a command for this or is it just a roundabout way? Kind regards, Norbert
-
Hello, I have just installed the UltraEngine. After creating a project, I open the test.sln in the editor. It starts Visual Studio 2022. When I now want to test the program I get the error message > Error (active) E1696 The file "Source" cannot be opened: "UltraEngine.h". Is anyone able to help me? Thanks Norbert
-
Can i render a model that is not in camaera range ?
norbert replied to norbert's topic in Programming
Thank you. Very bad. as even in openb3d and minib3d has that opportunity. well the model is outside the maximum range camera. norbert -
hi, it is possible to force render a model thats out of camera range ? i use c++.. thanks norbert
-
Hi, System::Print(Filesystem::GetFileSize("steam_appid.txt")); return always 0; System::Print(FileSystem::GetFileType("steam_appid.txt")); but return 1 by GetFileType so the file is still there ? have the problem with each file. it's a bug? or my mistake? working under Windows. 7 and c++. Does anyone have the same problem? thanks norbert
-
Problem with virtual light calculation in the shader
norbert replied to norbert's topic in Programming
So the problem was solved .... I think .... Changes in vertex shader: // My Code vec3 lightVec2 = normalize(LightPos-vec3(modelvertexposition)); mat3 normalMatrix = transpose(inverse(mat3(entitymatrix_))); vec3 Normal2 = normalMatrix * vertex_normal; Light_Intensity = max(dot(Normal2, lightVec2), 0.0)*10; -
Hello There, I want to let light a sphere with a virtual light. For that I have adapted a shader. But the problem is that the beam moved on the sphere. maybe could give me yes explain what I'm doing wrong someone. thank Norbert https://youtu.be/ZujlT_cdUTY i copy and change the standart default.shader changes in Vertex Shader: top: out float Light_Intensity; const vec3 LightPos = vec3(-100,0,0); main: vec3 ecPosition = vec3(modelvertexposition); vec3 tnorm = normalize(nmat* vertex_normal); vec3 lightVec2 = normalize(LightPos-ecPosition); Light_Intensity = max(dot(lightVec2, tnorm), 0.0); changes in Fragment Shader: top: in float Light_Intensity; main: fragData0 = outcolor * Light_Intensity; // My Code fragData2 = vec4(vec3(fragData0),materialflags/255.0); // leuchten lassen Complett Shader #version 400 #define MAX_INSTANCES 256 //Uniforms //uniform mat4 entitymatrix; uniform vec4 materialcolordiffuse; uniform mat4 projectioncameramatrix; uniform mat4 camerainversematrix; uniform instancematrices { mat4 matrix[MAX_INSTANCES];} entity; uniform vec4 clipplane0 = vec4(0.0); //Attributes in vec3 vertex_position; in vec4 vertex_color; in vec3 vertex_normal; in vec3 vertex_binormal; in vec3 vertex_tangent; in vec2 vertex_texcoords0; //Outputs //out vec4 ex_color; out float ex_selectionstate; //out vec3 ex_VertexCameraPosition; //out vec3 ex_normal; //out vec2 ex_texcoords0; //Tessellation out vec4 vPosition; out vec2 vTexCoords0; out vec3 vNormal; out vec3 vBinormal; out vec3 vTangent; out vec4 vColor; out float clipdistance0; // My out float Light_Intensity; const vec3 LightPos = vec3(-100,0,0); void main() { mat4 entitymatrix = entity.matrix[gl_InstanceID]; mat4 entitymatrix_=entitymatrix; entitymatrix_[0][3]=0.0; entitymatrix_[1][3]=0.0; entitymatrix_[2][3]=0.0; entitymatrix_[3][3]=1.0; vColor=vec4(entitymatrix[0][3],entitymatrix[1][3],entitymatrix[2][3],entitymatrix[3][3]); vec4 modelvertexposition = entitymatrix_ * vec4(vertex_position,1.0); //ex_VertexCameraPosition = vec3(camerainversematrix * modelvertexposition); //Clip planes if (length(clipplane0.xyz)>0.0001) { clipdistance0 = modelvertexposition.x*clipplane0.x + modelvertexposition.y*clipplane0.y + modelvertexposition.z*clipplane0.z + clipplane0.w; } else { clipdistance0 = 0.0; } vPosition = modelvertexposition; gl_Position = projectioncameramatrix * vPosition; mat3 nmat = mat3(camerainversematrix[0].xyz,camerainversematrix[1].xyz,camerainversematrix[2].xyz);//39 nmat = nmat * mat3(entitymatrix[0].xyz,entitymatrix[1].xyz,entitymatrix[2].xyz);//40 vNormal = normalize(nmat * vertex_normal); vBinormal = normalize(nmat * vertex_binormal); vTangent = normalize(nmat * vertex_tangent); vTexCoords0 = vertex_texcoords0; vColor = vec4(entitymatrix[0][3],entitymatrix[1][3],entitymatrix[2][3],entitymatrix[3][3]); vColor *= vec4(1.0-vertex_color.r,1.0-vertex_color.g,1.0-vertex_color.b,vertex_color.a) * materialcolordiffuse; // My Code vec3 ecPosition = vec3(modelvertexposition); vec3 tnorm = normalize(nmat* vertex_normal); vec3 lightVec2 = normalize(LightPos-ecPosition); Light_Intensity = max(dot(lightVec2, tnorm), 0.0); } #version 400 #define BFN_ENABLED 1 //Uniforms uniform int lightingmode; uniform vec2 buffersize; uniform vec2 camerarange; uniform float camerazoom; uniform vec4 materialcolorspecular; uniform vec4 lighting_ambient; uniform samplerCube texture15; //Inputs in float ex_selectionstate; in vec2 vTexCoords0; in vec3 vNormal; in vec3 vBinormal; in vec3 vTangent; in vec4 vColor; in float clipdistance0; //Outputs out vec4 fragData0; out vec4 fragData1; out vec4 fragData2; out vec4 fragData3; // My in float Light_Intensity; void main(void) { //Clip plane discard if (clipdistance0>0.0) discard; vec4 outcolor = vColor; fragData0 = outcolor * Light_Intensity; // My Code vec3 normal=vNormal; #if BFN_ENABLED==1 //Best-fit normals fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z))); fragData1.a = fragData0.a; #else //Low-res normals fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a); #endif fragData1.a = materialcolorspecular.r * 0.299 + materialcolorspecular.g * 0.587 + materialcolorspecular.b * 0.114; //int materialflags=1; //if (ex_selectionstate>0.0) materialflags += 2; //fragData2 = vec4(0.0,0.0,0.0,materialflags/255.0); int materialflags=1; if (ex_selectionstate>0.0) materialflags += 2; //fragData2 = vec4(0.0,0.0,0.0,materialflags/255.0); fragData2 = vec4(vec3(fragData0),materialflags/255.0); // leuchten lassen }
-
thanks for the info.
-
hello, i buy on steam the SciFi Interior Construction Kit. how can i access the Example scenes to demonstrate usage and provide ideas? mfg norbert
-
Hello Admin, the commands math.sqrt() or Math.sqrt() are unknown to the editor. and the text not glow blue. greeting Norbert
-
Hello, when i call the command sqrt in lua script this error message is displayed: calling ´sqrt´ on bad self (number expected, got table) local test test = math:sqrt(2) System:Print(test) greeting norbert
-
Hi Rick, you can do so if I have understood the question correctly. local planet planet = Prefab:Load("Prefabs/BlueFrozen/Planeten/Planet1.pfb") planet.script.Prefabs = "Prefabs/BlueFrozen/Planeten/Planet1.pfb" System:Print(planet.script.Prefabs) greeting norbert
-
hi, ok the error is gone.think that was my mistake. in my script i write a comment -- Änderung gegenüber altem code (1 -1) I change to -- aenderung gegenueber altem code (1 -1) now everything is ok again. greeting norbert
-
Hello, in debuger mode I get an error message. there is something of drive f in it. but I have no drive f whenever I click on ignore 4 with the mouse it goes on normally. jemmand has an idea? greeting norbert
-
Hello Georjack, 1. You can save and load your game state. you must write your own loader with this commands --> http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/stream/ 2. Yes you can create a simple gui by use the context commads--> http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/context/ 3. A Exe is included but the lua code ist not encrypted and everyone can read it. I have read but I think that this may soon be encrypted with leadwerks. if not you can use MoleBox indeed. 4 and 5, I can not help you. greeting norbert
-
Hi Dude, I would like generating a second world. with a camera from the second world I want to render in the skybox from the first world. greeting norbert
-
hi shadmar, I want to draw in the skybox cubemap in realtime. when i draw to position 0,0 self.context:DrawImage(self.sample,0,0) the green texture is visible but on other coordinates it has no effect. greeting norbert
-
I would like to draw a image in the skybox cubemap. But has only a effect when i draw the image at position 0,0 all others has no effect. in function App:Start() iam create the skybox --Create skybox sky = Model:Create() --just render a plane and project cubemap onto it local surface = sky:AddSurface() surface:AddVertex(-0.5,-0.5,0, 0,0,-1) surface:AddVertex(0.5,-0.5,0, 0,0,-1) surface:AddVertex(0.5,0.5,0, 0,0,-1) surface:AddVertex(-0.5,0.5,0, 0,0,-1) surface:AddTriangle(2,1,0) surface:AddTriangle(0,3,2) --position in front of camera but far out to near camera clip plane sky:SetPosition(self.FPS_CAM:GetPosition()) sky:SetRotation(self.FPS_CAM:GetRotation()) sky:Move(0,0,self.FPS_CAM:GetRange().y-50) sky:SetScale(self.FPS_CAM:GetRange().y*10) sky:SetParent(self.FPS_CAM) -- and paint it skymat=Material:Load("Materials/Sky/myskybox1.mat") sky:SetMaterial(skymat) self.skytexture = skymat:GetTexture() self.FPSbuffer = Buffer:Create(2048,1536,1,0,0) self.FPSbuffer:SetColorTexture(self.skytexture) in function App:Loop() self.FPSbuffer:Enable() self.FPSbuffer:Clear() self.context:DrawImage(self.sample,0,0) self.FPSbuffer:Disable() there is an extra command to sign in a cubemap? have seen there is also an extra shader. Shaders \ Drawing \ drawimagecubemap.shader greeting norbert
-
I've heard its needed to import dlls to lua script. greeting norbert
-
Hi, Is there a tutorial for installing LuaJIT for leadwerks 3.1 indie edition? I have download and install the latest version of MinGW and i have downlad LuaJIT-2.0.2 when i try to build with the command "mingw32-make" comes the following error: does anyone have an idea what I'm doing wrong? greeting norbert
-
change resolution,antialias or lighting quality in lua ?
norbert replied to norbert's topic in Programming
and if the player wants to make later settings? quality for the light? greeting norbert -
Hello, Where can you change the graphics resolution in lua? And the render quality as antialias or lighting quality? for the final exe file? someone has an idea? greeting norbert
-
Leadwerks 3.1 Indie access variables from other script ?
norbert replied to norbert's topic in Programming
Thanks, it is possible to access the camera its create in FPSPlayer.lua from the app.lua script ? self.FPSPlayer.Player:Hide() gruss norbert -
Hello, how can I access variables from other script ? function App:Loop() .. .. self.context:DrawText(self.FPSPlayer.Player.health,2,240) .. .. end is show the error "attempt to index field 'FPSPlayer' (a nil value)" can somebody help me. gruss norbert
-
Hi Rick, thank you, That's exactly what I mean.