Jump to content

The graphics are not working while the game is playing.


Go to solution Solved by Josh,

Recommended Posts

Posted

In the editor, I see the curvature of the stones in the material, and the shadows. Perhaps it has something to do with the video card as well. As soon as I turn on the game, everything I saw in the editor disappears. At the same time, all the parameters in the video are included.

image.thumb.png.d96170a6e4c67eb5a6d0a460ebcd79b1.png

 

image.thumb.png.e745fd8d3c8bb79e636855506597ac9c.png

image.thumb.png.44c1d0595c53e826c3696ad6da0b6f39.png

 

The render, on the contrary, shows that everything is fine.

image.thumb.png.0eb68068b900bd4b9349c5fb2dea840e.png

  • Solution
Posted

Enable refraction and tessellation on the game camera by adding those commands to the code.

  • Like 1
  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted
1 hour ago, Josh said:

Enable refraction and tessellation on the game camera by adding those commands to the code.

how to access the camera if it already exists on stage. In your examples, everything goes through the main script. I created the component and put it on the camera. How do I connect the tessellation to this particular camera?

Posted

In your component, do this:

local camera = Camera(self.entity)
if camera ~= nil then camera:SetTessellation(4) end

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

and I found everything, there the player listens for the presence of the camera and then sets the parameters. I did the same and everything worked.

if not self.camera then
        self.camera = CreateCamera(world)
       self.camera:Listen()
    end

    local pos = entity:GetPosition(true)
    self.camera:SetPosition(pos.x, pos.y + self.eyeheight, pos.z)
    self.camera:SetRotation(0, 0, 0)
    self.camera:SetFov(self.fov)
    self.camera:SetTessellation(3) 
    self.camera:SetRefraction(true)  

 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...