Hello guys,
so I've been playing around with the new Ogre Next 4.0.0 branch lately, and need some help.
I want to preface this by saying I'm not an expert at 3D graphics programming, so a lot of my questions likely just boil down to inexperience with 3D in general.
I'm at a point where I'd like to add terrain to my game. I am aware of the Sample_Tutorial_Terrain
, but can't get it to work on my machine with recent commit 40514676df.
Code: Select all
Vertex Shader: 100000013VertexShader_vs
Fragment Shader: 100000013PixelShader_ps
GLSL validation result :
active samplers with a different type refer to the same texture image unit
WARNING: GraphicsSystem::deinitialize() not called!!!
An exception has occured: OGRE EXCEPTION(5:ItemIdentityException): Parameter called blueNoiseTex does not exist. in GpuProgramParameters::_findNamedConstantDefinition at XYZ (line 2207)
I reckon I could try to fix the sample for my machine, but before delving into that I'd like to ask a few fundamental questions about Ogre Next and it's inner workings.
1
. How would I render 2D elements?
I know that the examples render 2D text on the screen, but couldn't figure out where, and even more so how.
In general, how do you draw something to the screen and have it appear in front of all other objects in a orthographic view?
2
. What is the compositor?
I've read that the compositor is usually used for post-processing effects.
So say I'd like to add chromatic abberation or a vignette effect, this is what I'd want to use?
Can you stack compositors and enable/disable them on the fly?
3
. What would I have to do to write a simple vertex shader for terrain displacement?
I could just use the Terrain example, but I don't think I'd learn much about working in tandem with Ogre if I did that.
So I figured I might as well just ask.
I'm aware that generating a terrain basically boils down to rendering a plane with reasonable amount of vertices and displacing them by sampling a heightmap in the vertex shader, and this is what I'd like to do for now.
But I truly don't know how to go on from here, how do I write these shaders and get them into Ogre? I've read something about shader pieces in the docs, but that's about it.
4
. In regards to materials, what is the preferred workflow nowadays? .material.json or .material scripts?
5
. Grass rendering.
I'd love to try billboarding to render a large amount of grass patches. From what I took away from a few posts on here, is that Ogre tries to use instancing with SCENE_STATIC whenever possible.
So would this take advantage of this instancing and uphold a high framerate?
Create a BillboardSet
Add 3 Billboard's to this set
Attach a unlit material
Create a bunch of SceneNodes for this BillboardSet with SCENE_STATIC and add differing positions
6
. RenderQueue's
How do I move an object to a different RenderQueue? I've read on a few posts here that terrain is supposed to be rendered last, but how do you actually enforce this?
Thank you for your patience.
Note: Sorry about the formatting, unfamiliar with the BB syntax and couldn't quite get it to look like I wanted.