Followers 0

# Engines - What to keep fixed and what not to

## 3 posts in this topic

Hi guys,

developers love to give the user the freedom they want, but sometimes, too much freedom is quite bad, as some things are just too complicated, or just not practical, or might mess stuff up if done wrong.

One example of this was where I had to decide whether to use fixed functions for normal mapping, or leave that to the user to do while editing their custom material. But normal mapping isn't just something that's done within a seconds (copy... paste...  ), so I decided to make it fixed, like: (And it's used so much, and if you mess it up, features like, ssao, lighting, just doesn't work!)

// Enable Normal Mapping
myMaterial->SetFlag(MAT_FLAG_NORMALS);

// Set the texture
myMaterial->SetNormalMap(myTexture);


So...

Is leaving the normal mapping to a fixed function the way to go, or not? What experiences do you have where you needed to decide whether making a feature fixed, or leave it to the user?

Thanks!

PS. I don't know if this is too specific, if so, please say!

1

##### Share on other sites

I would like to hear opinions on this subject as well. I personally think that it is completely up to you to decide. Some kind of "design" decision. But it is really hard to decide when you should really stop making things flexible.

0

##### Share on other sites

From the example you gave, I would say you don't need the SetFlag( MAT_FLAG_NORMALS ) call. The fact someone calls the SetNormalMap should be enough for the lower level API to realise they want normals which reduces it to a single call and reduces the chance of someone making a mistake.

I actually think this should all be completely hidden at the high level, so no code outside the core renderer has an API like that at all. But I guess that's not really the direction your engine has taken and requires tool support. Consider for example, the high level code states 'I have a mesh that I render' and the game engine gives it a mesh along with the material. Suddenly the high level code can now render anything the designer wants it to with no code change. Anyway, that's a long discussion and a bit of a tangent so I will leave it as perhaps thought for the future.

n!

0

## Create an account

Register a new account