• entries
    743
  • comments
    1924
  • views
    580458

Textures and fighting with the editor

Sign in to follow this  

1087 views

Fairly quick update today. I've added support for basic diffuse texturing to both the level editor and the game. The editor is very much bodged to support, but the game is handling it properly.

texture.jpg

I've added Texture and TexScale properties to the StaticMesh entity type. You can see them ringed in the next screenshot:

editor.jpg

At the moment in the editor the available texture (grass) is just hardcoded loaded, like the proxy meshes, but can add some UI for this later on.

So you just set the texture string ID on an object ("grass") and set the TexScale to size the texture correctly, and its good to go.

What I have had to do is, on export to the game file format, output multiple "internalmesh" objects, grouped by texture so that you end up with a mesh per texture. The game was already set up to load multiple internal meshes and static mesh instances, so this was pretty seamless from the game side.

I've also added a feature to the editor so that whatever object(s) are selected shoot a ray down from their centre to the nearest floor.

editor2.jpg

Makes it a lot easier to see where things are in the world and was a pretty trivial change, since I already had all the ray casting against entities code working for the select tool.

That's all for now. Thanks for stopping by.

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now