Closed irfanka closed 11 months ago
Sure, fork the repo and change whatever you want. Of course, there is no option, not sure what it does actually.
With C, you can do whatever you want, raylib-go needs to expose the option, and not many users if at all will want to change that.
fork the repo and change whatever you want
Yup, that's what I ended up doing.
not sure what it does actually
Controls the position of the far clipping plane of the camera frustum. Basically how far the camera will render; any geometry that's farther than RL_CULL_DISTANCE_FAR will simply not be rendered.
It is a bit weird that this is not exposed as an option; it's not that uncommon to tweak this in games.
For example, if you're making an open-world game (or just a very large game level), you'd want this value to be a lot higher than raylib default (1000.0
), in order to render distant terrain and such...
There are already many options in config header that user can adjust, but only in C raylib. Many of those doesn't make sense to implement as Go tags. This one is something that is not even in C config. So, it will not happen here, sorry.
What do you mean it's not in C config?
raylib-go/raylib/config.h : line 111
Sorry, I don't follow all the options for some years, if it is, and you want to be exposed, PR is welcome. I will not spend my time on this.
Well, it's probably a better idea to figure out a generic way to override any option in config.h, instead of just exposing this single one.
What do you think would be the right way to do that? cgo CFLAGS?
Well, generic way is Go tags. There are already examples in this repo. I don't think there is a better way, but fill free to prove me wrong.
Of course, you can ignore everything that is defined and pass to CGO_CFLAGS whatever you want. It is not related to any change in this repo.
Ok, just tested with CGO_CFLAGS="-DRL_CULL_DISTANCE_FAR=500.0" go build
and it does work, it shows redefined warnings. For such options that seems to be the best method.
Just in case anyone else bumps into this issue.
I struggled to get this working from my C project until I added this to my own CMakeLists.txt file:
target_compile_definitions("raylib" PUBLIC "RL_CULL_DISTANCE_FAR=10000.0")
Hi!
I'm new to Golang and raylib-go, so this might be a dumb question but..
Is there any way I can override
RL_CULL_DISTANCE_FAR
? I'm usingCameraThirdPerson
and am trying to increase the render distance.Thanks!